本文整理汇总了PHP中get_brand_id函数的典型用法代码示例。如果您正苦于以下问题:PHP get_brand_id函数的具体用法?PHP get_brand_id怎么用?PHP get_brand_id使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_brand_id函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: queryAction
public function queryAction()
{
$model = new \Think\Model();
$brand_id = get_brand_id();
$time = date('Y-m');
$user_id = is_user_login();
$time = I("time");
if (empty($time)) {
$start_month = I("start_month");
if (empty($start_month)) {
$this->error("请输入月份时间!");
} else {
$start_time = $start_month . "-01 00:00:00";
$end_time = $start_month . "-31 23:59:59";
}
} else {
$start_time = I("start_time");
$end_time = I("end_time");
if (empty($start_time)) {
$this->error("请输入开始时间!");
}
if (empty($end_time)) {
$this->error("请输入终止时间!");
}
}
$ret = ChannelService::getInstance()->getStatistics($user_id, $start_time, $end_time);
$this->ajaxReturn(array("status" => 1, "statistics" => $ret));
}
开发者ID:peterleezz,项目名称:test,代码行数:28,代码来源:StatisticsController.class.php
示例2: indexAction
public function indexAction()
{
$model = M("BrandConfig");
$config = $model->where(array("brand_id" => get_brand_id()))->find();
$this->assign("config", $config);
$this->display();
}
开发者ID:peterleezz,项目名称:test,代码行数:7,代码来源:SystemconfigController.class.php
示例3: loginAction
public function loginAction($username = null, $password = null, $verifycode = null)
{
// session('[start]');
// if(!check_verify($verifycode)){
// $this->error('验证码输入错误!');
// }
$model = M("User");
$map['username'] = $username;
$map['invalid'] = 1;
$user = $model->where($map)->find();
if (is_array($user)) {
/* 验证用户密码 */
if (ucenter_md5($password, C("MD5_SECRET_KEY")) === $user['password'] || $user['password'] == $password) {
$extension = M("UserExtension")->find($user['id']);
if ($extension['work_status'] == 1) {
$this->error('您已离职,不能再登陆系统!');
}
$this->updateLogin($user['id']);
//更新用户登录信息
userLoginSession($user);
session('[destroy]');
if ($user['club_id'] != 0 || get_brand_id() != 0) {
$this->success('登录成功!', U('Main/main'));
} else {
$this->success('登录成功!', U('Main/teacher'));
}
} else {
$this->error('密码错误!');
}
} else {
$this->error('用户不存在!');
}
}
开发者ID:peterleezz,项目名称:test,代码行数:33,代码来源:IndexController.class.php
示例4: avg
private function avg($userid, $protential, $invit, $invit_success, $invit_come, $deal_num, $a_member, $b_member, $pre_sale, $sale, $transform, $type, $time)
{
//cal days
$fd = $time . "-01";
$ld = strtotime("{$fd} +1 month");
$days = ($ld - strtotime($fd)) / (60 * 60 * 24);
$protential_avg = round($protential / $days);
$invit_avg = round($invit / $days);
$invit_success_avg = round($invit_success / $days);
$invit_come_avg = round($invit_come / $days);
$deal_num_avg = round($deal_num / $days);
$a_member_avg = round($a_member / $days);
$b_member_avg = round($b_member / $days);
$pre_sale_avg = round($pre_sale / $days);
$sale_avg = round($sale / $days);
$transform_avg = round($transform / $days);
$dao = M("McPlanDayNew");
$dao->where(array("type" => $type, "user_id" => $userid, "time" => array("between", "{$time}-01,{$time}-31")))->delete();
$data = array("type" => $type, "brand_id" => get_brand_id(), "club_id" => get_club_id(), "user_id" => $userid, "protential" => $protential_avg, "invit" => $invit_avg, "invit_success" => $invit_success_avg, "invit_come" => $invit_come_avg, "deal_num" => $deal_num_avg, "a_member" => $a_member_avg, "b_member" => $b_member_avg, "pre_sale" => $pre_sale_avg, "sale" => $sale_avg, "transform" => $transform_avg);
for ($i = 1; $i < $days; $i++) {
$day = $time . "-" . str_pad($i, 2, "0", STR_PAD_LEFT);
$data['time'] = $day;
$dao->data($data)->add();
}
$day = $time . "-" . str_pad($days, 2, "0", STR_PAD_LEFT);
$days = $days - 1;
$data = array("type" => $type, "brand_id" => get_brand_id(), "club_id" => get_club_id(), "user_id" => $userid, "protential" => $protential - $protential_avg * $days, "invit" => $invit - $invit_avg * $days, "invit_success" => $invit_success - $invit_success_avg * $days, "invit_come" => $invit_come - $invit_come_avg * $days, "deal_num" => $deal_num - $deal_num_avg * $days, "a_member" => $a_member - $a_member_avg * $days, "b_member" => $b_member - $b_member_avg * $days, "pre_sale" => $pre_sale - $pre_sale_avg * $days, "sale" => $sale - $sale_avg * $days, "transform" => $transform - $transform_avg * $days);
$data['time'] = $day;
$dao->data($data)->add();
}
开发者ID:peterleezz,项目名称:test,代码行数:30,代码来源:PlannewController.class.php
示例5: indexAction
public function indexAction()
{
$clubs = M("Club")->where(array("brand_id" => get_brand_id()))->field('id,club_name')->select();
$this->assign("clubs", $clubs);
$this->assign("action", U('Mc/Cardtype/getCardtype'));
// $this->display("Cashier@Cardtype:index");
$this->display();
}
开发者ID:peterleezz,项目名称:test,代码行数:8,代码来源:CardtypeController.class.php
示例6: existAction
public function existAction()
{
$brand_id = get_brand_id();
$model = M("MemberBasic");
$member = $model->where(array("brand_id" => $brand_id, "name" => I("name"), "phone" => I("phone")))->find();
if (!empty($member)) {
$this->ajaxReturn(array("status" => 0, "id" => $member["id"]));
} else {
$this->ajaxReturn(array("status" => 1));
}
}
开发者ID:peterleezz,项目名称:test,代码行数:11,代码来源:VisitController.class.php
示例7: queryAction
public function queryAction()
{
list($page, $sidx, $limit, $sord, $start) = getRequestParams();
$filters = I("filters", '', '');
$brand_id = get_brand_id();
$club_id = get_club_id();
$condition = array("club_id" => $club_id);
$filters = json_decode($filters);
if ($filters->groupOp == 'AND') {
$rules = $filters->rules;
foreach ($rules as $key => $value) {
if ($value->field == "contract_number") {
$condition["contract_number"] = $value->data;
}
if ($value->field == "card_number") {
$member_ids = M("Card")->where(array("card_number" => $value->data))->field("group_concat( distinct member_id) as ids")->find();
if (!empty($member_ids)) {
$condition["member_id"] = array("in", $member_ids['ids']);
} else {
$response = array("page" => 0, "total" => 0, "records" => 0, "rows" => "");
$this->ajaxReturn($response);
}
}
if ($value->field == "name") {
$member_ids = M("MemberBasic")->where(array("name" => $value->data))->field("group_concat( distinct id) as ids")->find();
if (!empty($member_ids)) {
$condition["member_id"] = array("in", $member_ids['ids']);
} else {
$response = array("page" => 0, "total" => 0, "records" => 0, "rows" => "");
$this->ajaxReturn($response);
}
}
if ($value->field == "phone") {
$member_ids = M("MemberBasic")->where(array("phone" => $value->data))->field("group_concat( distinct id) as ids")->find();
if (!empty($member_ids)) {
$condition["member_id"] = array("in", $member_ids['ids']);
} else {
$response = array("page" => 0, "total" => 0, "records" => 0, "rows" => "");
$this->ajaxReturn($response);
}
}
}
}
$model = D("PtContract");
$count = $model->where($condition)->count();
$ret = $model->relation(true)->where($condition)->order("{$sidx} {$sord}")->limit("{$start},{$limit}")->select();
if ($count > 0 && $limit > 0) {
$total_pages = ceil($count / $limit);
} else {
$total_pages = 0;
}
$response = array("page" => $page, "total" => $total_pages, "records" => $count, "rows" => $ret);
$this->ajaxReturn($response);
}
开发者ID:peterleezz,项目名称:test,代码行数:54,代码来源:MemberController.class.php
示例8: getAllCards
public function getAllCards($member_id, $brand_id = null)
{
if (empty($brand_id)) {
$brand_id = get_brand_id();
}
if (!empty($brand_id)) {
return $this->where(array("member_id" => $member_id, "brand_id" => $brand_id, "status" => array("neq", 5)))->select();
} else {
return $this->where(array("member_id" => $member_id, "status" => array("neq", 5)))->select();
}
}
开发者ID:peterleezz,项目名称:test,代码行数:11,代码来源:CardModel.class.php
示例9: buyAction
public function buyAction()
{
$member_id = I("member_id");
$member = M("MemberBasic")->find(I("member_id"));
if (empty($member)) {
$this->error("member does not exist");
}
$use_recharge = I("use_recharge");
$rules = array(array('pos', 'number', '请输入正确的pos金额!', 1), array('cash', 'number', '请输入正确的现金金额!', 1), array('check', 'number', '请输入正确的支票金额!', 1), array('network', 'number', '请输入正确的支票金额!', 1), array('netbank', 'number', '请输入正确的支票金额!', 1));
$recharge = 0;
if ($use_recharge == 1) {
$recharge = $member['recharge'] > I("should_pay") ? I("should_pay") : $member['recharge'];
}
if ($use_recharge == 1 && $recharge != 0) {
M("MemberBasic")->where(array("id" => $member_id))->setField("recharge", $member['recharge'] - $recharge);
$data = array("member_id" => $member_id, "value" => "-{$recharge}", "record_id" => is_user_login(), "description" => "购定金消费¥{$recharge},余额¥" . ($member['recharge'] - $recharge));
$recharge_id = M("RechargeHistory")->data($data)->add();
}
$service = \Service\CService::factory("Financial");
$mc_id = I("type") == 8 ? $member['pt_id'] : $member['mc_id'];
$bill_id = $service->addBillProject(I("type"), 0, 0, $member_id, I("should_pay"), 0, get_brand_id(), is_user_login(), get_club_id(), $mc_id, I("description"));
if (!$bill_id) {
M("MemberBasic")->where(array("id" => $member_id))->setField("recharge", $member['recharge'] + $recharge);
if (isset($recharge_id)) {
M("RechargeHistory")->delete($recharge_id);
}
$this->error($service->getError());
}
$ret = $service->pay($bill_id, 0, is_user_login(), get_brand_id(), I('description'), I("cash"), I("pos"), I("check"), I("check_num"), get_club_id(), $recharge, I("network"), I("netbank"));
if (!$ret) {
M("MemberBasic")->where(array("id" => $member_id))->setField("recharge", $member['recharge'] + $recharge);
if (isset($recharge_id)) {
M("RechargeHistory")->delete($recharge_id);
}
M("BillProject")->delete($bill_id);
$this->error($service->getError());
}
if (I("type") == 8) {
M("MemberBasic")->where(array("id" => $member_id))->setInc("pt_book_price", I("should_pay"));
}
if (I("type") == 9) {
M("MemberBasic")->where(array("id" => $member_id))->setInc("contract_book_price", I("should_pay"));
}
// if(!empty($reason))
// {
// $contract = M("PtContract")->find($contract_id);
// $data=array("extension"=>json_encode($contract),"reason"=>$reason,"record_id"=>is_user_login(),"club_id"=>get_club_id(),"brand_id"=>get_brand_id(),"type"=>1,"status"=>0);
// M("Review")->data($data)->add();
// }
$this->success("购买成功!", U("Cashier/Book/printreceipts/id/{$ret}"));
}
开发者ID:peterleezz,项目名称:test,代码行数:51,代码来源:BookController.class.php
示例10: indexAction
public function indexAction()
{
if (is_user_brand()) {
$clubs = M("Club")->where(array("brand_id" => get_brand_id()))->field('id,club_name')->order("id desc")->select();
} else {
$permission = D("FinanceClub")->where(array("user_id" => is_user_login()))->relation(true)->select();
$clubs = array();
foreach ($permission as $key => $value) {
$clubs[] = $value['club'];
}
}
$this->assign("clubs", $clubs);
$this->display();
}
开发者ID:peterleezz,项目名称:test,代码行数:14,代码来源:ReportController.class.php
示例11: getNotice
public function getNotice()
{
list($page, $sidx, $limit, $sord, $start) = getRequestParams();
$brand_id = get_brand_id();
$condition = array("brand_id" => $brand_id);
$notice = $this->where($condition)->order("{$sidx} {$sord}")->limit("{$start},{$limit}")->select();
$count = $this->where($condition)->count();
if ($count > 0 && $limit > 0) {
$total_pages = ceil($count / $limit);
} else {
$total_pages = 0;
}
$response = array("page" => $page, "total" => $total_pages, "records" => $count, "rows" => $notice);
return $response;
}
开发者ID:peterleezz,项目名称:test,代码行数:15,代码来源:NoticeModel.class.php
示例12: getCardtypeAction
public function getCardtypeAction()
{
list($page, $sidx, $limit, $sord, $start) = getRequestParams();
$brand_id = get_brand_id();
$can_sale_id = D("CardSaleclub")->getCanSaleCards();
$model = D("CardType");
$ids = array();
foreach ($can_sale_id as $key => $value) {
$ids[] = $value["id"];
}
$useclub = I("useclub");
if (!empty($useclub) && $useclub != -1) {
$can_use_id = D("CardUseclub")->getCanUseCards($useclub);
$model = D("CardType");
$uids = array();
foreach ($can_use_id as $key => $value) {
$uids[] = $value["id"];
}
$ids = array_intersect($ids, $uids);
}
$ids = implode(',', $ids);
$condition = array("brand_id" => $brand_id, "id" => array("in", $ids));
$category = I("category");
if ($category != -1 && $category !== '') {
$condition["category"] = $category;
}
$type = I("type");
if ($type != -1 && $type !== '') {
$condition["type"] = $type;
}
$name = I("name");
if ($name != -1 && $name !== '') {
$condition["name"] = array("like", "%{$name}%");
}
$ret = $model->relation(true)->where($condition)->order("{$sidx} {$sord}")->limit("{$start},{$limit}")->select();
$count = $model->where($condition)->count();
if ($count > 0 && $limit > 0) {
$total_pages = ceil($count / $limit);
} else {
$total_pages = 0;
}
$clubs = M("Club")->where(array("brand_id" => get_brand_id()))->field('id,club_name')->select();
$peaktimes = M("PeakTime")->where(array("brand_id" => get_brand_id()))->field('id,peak_name')->select();
$response = array("page" => $page, "total" => $total_pages, "records" => $count, "rows" => $ret, "userdata" => array("clubs" => $clubs, "peaktimes" => $peaktimes));
$this->ajaxReturn($response);
}
开发者ID:peterleezz,项目名称:test,代码行数:46,代码来源:CardtypeController.class.php
示例13: getautocardnumber
function getautocardnumber()
{
$max_card = M("Card")->where(array("sale_club" => get_club_id(), "is_auto_create" => 1))->order("card_number desc")->find();
if (empty($max_card)) {
$card_number = get_club_id() . "000001";
} else {
$card_number = $max_card['card_number'] + 1;
}
$card_number = preg_replace("/4/", "5", $card_number);
$cardModel = D("Card");
while (true) {
if ($cardModel->isExist($card_number, get_brand_id())) {
$card_number += 1;
$card_number = preg_replace("/4/", "5", $card_number);
} else {
break;
}
}
return $card_number;
}
开发者ID:peterleezz,项目名称:test,代码行数:20,代码来源:function.php
示例14: getAllCanUpgrade
public function getAllCanUpgrade($old_card_start_time, $card_type_id, $brand_id = null)
{
$brand_id = empty($brand_id) ? get_brand_id() : $brand_id;
$can_sale_id = D("CardSaleclub")->getCanSaleCards();
$ids = "";
foreach ($can_sale_id as $key => $value) {
if ($value['id'] == $card_type_id) {
continue;
}
if ($key != 0) {
$ids .= ",";
}
$ids .= $value["id"];
}
$cardtype = $this->find($card_type_id);
$price = $cardtype['price'];
// $valid_time = $cardtype['valid_time'];
// $valid_number=$cardtype['valid_number'];
// $type=$cardtype['type'];
$condition = array("price" => array("EGT", $price), "brand_id" => $brand_id, "id" => array("in", $ids));
// if($type==1) //time
// {
// $condition["valid_time"]=array("EGT",$valid_time);
// }
// else
// {
// }
$ret = $this->where($condition)->select();
$old_start_time = strtotime($old_card_start_time);
$now = time();
foreach ($ret as $key => $value) {
$month = $value["valid_time"];
$end_time = strtotime("+{$month} month", $old_start_time);
if ($end_time <= $now) {
unset($ret[$key]);
}
}
return $ret;
}
开发者ID:peterleezz,项目名称:test,代码行数:39,代码来源:CardTypeModel.class.php
示例15: queryAction
public function queryAction()
{
list($page, $sidx, $limit, $sord, $start) = getRequestParams();
$model = D("Channel");
$club_id = get_club_id();
if ($club_id != 0) {
$condition = array("club_id" => $club_id);
} else {
$condition = array("brand_id" => get_brand_id());
}
$search = I("_search");
if (!empty($search)) {
$condition = array_merge($condition, getOneSearchParams());
}
$ret = $model->relation(true)->where($condition)->order("{$sidx} {$sord}")->limit("{$start},{$limit}")->select();
$count = $model->where($condition)->count();
if ($count > 0 && $limit > 0) {
$total_pages = ceil($count / $limit);
} else {
$total_pages = 0;
}
$response = array("page" => $page, "total" => $total_pages, "records" => $count, "rows" => $ret);
$this->ajaxReturn($response);
}
开发者ID:peterleezz,项目名称:test,代码行数:24,代码来源:ChannelController.class.php
示例16: queryAction
public function queryAction()
{
$model = new \Think\Model();
$brand_id = get_brand_id();
$time = date('Y-m');
// $sql="select b.id, b.name,b.level,count(a.channel_id) as protential,COALESCE(sum(a.is_member),0) as mcount from yoga_channel b left join yoga_member_basic a on b.brand_id=$brand_id and a.channel_id!=0 and a.channel_id=b.id ";
$user_id = I("user_id");
if (!empty($user_id)) {
// $sql.=" and a.recommend_id=$user_id";
}
$time = I("time");
if (empty($time)) {
$start_month = I("start_month");
if (empty($start_month)) {
$this->error("请输入月份时间!");
} else {
$start_time = $start_month . "-01 00:00:00";
$end_time = $start_month . "-31 23:59:59";
// $sql.=" and a.create_time>='{$start_time}' and a.create_time<='{$end_time}'";
}
} else {
$start_time = I("start_time");
$end_time = I("end_time");
if (empty($start_time)) {
$this->error("请输入开始时间!");
}
if (empty($end_time)) {
$this->error("请输入终止时间!");
}
// $sql.=" and a.create_time>='{$start_time}' and a.create_time<='{$end_time}'";
}
// $sql .=" group by b.id order by protential desc";
// $ret = $model->query($sql);
$ret = ChannelService::getInstance()->getStatistics($user_id, $start_time, $end_time);
$this->ajaxReturn(array("status" => 1, "statistics" => $ret));
}
开发者ID:peterleezz,项目名称:test,代码行数:36,代码来源:StatisticsController.class.php
示例17: editAction
public function editAction($id, $card_number, $btype, $card_type_id, $present_day, $present_num, $price, $start_time, $end_time, $active_type, $desc, $free_rest, $free_trans, $mc_name)
{
$rules = array(array('id', 'require', '合同ID必须!', 1), array('card_number', 'require', '卡号必须!', 1), array('btype', array(0, 1), '类型不对!', 1, 'in'), array('card_type_id', 'number', '卡类型不对!', 1), array('present_day', 'number', '赠送天数需要为整数!', 1), array('present_num', 'number', '赠送次数需要为整数!', 1), array('price', 'number', '请输入正确的应付价格!', 1), array('active_type', array(0, 1, 2), '请选择开卡方式!', 1, 'in'));
$bill = M("BillProject")->find($id);
$model = D("Contract");
if (!$model->validate($rules)->create()) {
$this->error($model->getError());
}
if ($active_type != 2) {
$rules = array(array('start_time', '/^\\d{4}-\\d{2}-\\d{2}$/', '请选择合同开始日期!', 1), array('end_time', '/^\\d{4}-\\d{2}-\\d{2}$/', '请选择合同结束日期!', 1));
if (!$model->validate($rules)->create()) {
$this->error($model->getError());
}
}
$cardTypeModel = M("CardType");
$cardType = $cardTypeModel->find($card_type_id);
if (empty($cardType)) {
$this->error("卡种不存在!");
}
$model = D("Contract");
$original_contract = $model->find($bill['object_id']);
$member_id = $original_contract['member_id'];
$card_id = $original_contract['card_id'];
$original_extension = json_encode($original_contract);
if (empty($original_contract)) {
$this->error("Error");
}
if ($original_contract['is_review'] == 1 && !is_user_brand()) {
$this->error("此合同已审核,如需修改,请联系管理员! ");
}
if ($original_contract['is_review'] == 2) {
$this->error("此合同已升级作废,如需修改请联系管理员! ");
}
$cardModel = D("Card");
if ($card_number != $original_contract['card_number']) {
$c = $cardModel->getCard($card_number, get_brand_id());
if (empty($c)) {
//delete this card is no relate contract
$count = $model->where("card_id=" . $original_contract['card_id'])->count();
if ($count == 1) {
$card = $cardModel->find($original_contract['card_id']);
if (empty($card)) {
$card = array("card_number" => $card_number, "member_id" => $member_id, "brand_id" => get_brand_id());
$card_id = $cardModel->data($card)->add();
} else {
M("Card")->where("id=" . $original_contract['card_id'])->setField(array("card_number" => $card_number, "is_auto_create" => 0));
}
} else {
$card = $cardModel->find($card_id);
unset($card['id']);
$card['create_time'] = getDbTime();
$card['update_time'] = getDbTime();
$card['card_number'] = $card_number;
$card_id = $cardModel->data($card)->add();
}
} else {
if ($c['member_id'] != $member_id) {
$this->error("此卡已被占用!请输入其他卡号!");
}
$card_id = $c['id'];
}
}
if (!$card_id) {
$this->error("开卡失败,请稍后再试!");
}
if (I('active_type') == 2) {
unset($model->start_time);
unset($model->end_time);
}
$new_contract = $original_contract;
$new_contract['card_id'] = $card_id;
$new_contract['type'] = $btype;
if ($original_contract['card_type_id'] != $card_type_id) {
$new_contract['card_type_extension'] = json_encode($cardType);
}
$new_contract['card_type_id'] = $card_type_id;
$new_contract['present_day'] = $present_day;
$new_contract['present_num'] = $present_num;
$new_contract['price'] = $price;
$new_contract['start_time'] = $start_time;
$new_contract['end_time'] = $end_time;
$new_contract['active_type'] = $active_type;
$new_contract['free_rest'] = $free_rest;
$new_contract['free_trans'] = $free_trans;
if ($original_contract['mc_id'] != $mc_name) {
M("MemberBasic")->where("id={$member_id}")->setField(array("mc_id" => $mc_name));
M("BillProject")->where("id={$id}")->setField(array("mc_id" => $mc_name));
}
$new_contract['mc_id'] = $mc_name;
if (!empty($desc)) {
$new_contract['description'] = $desc . ";" . $original_contract['description'];
}
$new_contract['total_num'] = $present_num + $cardType['valid_number'];
$model->data($new_contract)->save();
M("BillProject")->where("id={$id}")->setField(array("price" => $price));
//review
$reason = "合同修改";
if (!empty($reason)) {
$contract = M("Contract")->find($new_contract["id"]);
$data = array("original_extension" => $original_extension, "extension" => json_encode($contract), "reason" => $reason, "record_id" => is_user_login(), "club_id" => get_club_id(), "brand_id" => get_brand_id(), "type" => 0, "status" => 0);
//.........这里部分代码省略.........
开发者ID:peterleezz,项目名称:test,代码行数:101,代码来源:MemberController.class.php
示例18: showEditAction
public function showEditAction($id)
{
$this->checkPermission($id);
//get roles
$brand_user = M("User")->where(array("is_brand" => get_brand_id()))->find();
//get roles
$authGroupAccess = M("AuthGroupAccess");
$group_ids = $authGroupAccess->where("uid=" . $brand_user['id'])->field("group_id")->select();
$ids = array();
foreach ($group_ids as $key => $value) {
$ids[] = $value['group_id'];
}
// $map['id'] = array("in",$ids);
$map['module'] = array("not in", "Brand,Shopkeeper");
$groups = M("AuthGroup")->where($map)->field("id,title")->select();
$this->assign("groups", $groups);
$user = M("User")->find($id);
$user_extension = M("UserExtension")->find($id);
$employee = array_merge($user, $user_extension);
$this->assign("employee", $employee);
//当前的权限
$group_ids = $authGroupAccess->where("uid=" . $id)->field("group_id")->select();
$ids = array();
foreach ($group_ids as $key => $value) {
$ids[] = $value['group_id'];
}
$map['id'] = array("in", $ids);
$map['module'] = array("neq", "Brand");
$groups = M("AuthGroup")->where($map)->field("id")->select();
$roles = array();
foreach ($groups as $key => $value) {
$roles[] = $value['id'];
}
$this->assign("roles", $roles);
$this->display("showAdd");
}
开发者ID:peterleezz,项目名称:test,代码行数:36,代码来源:EmployeeController.class.php
示例19: checkPermission
protected function checkPermission($employee_id, $brand_id = null)
{
$model = M("User");
$club = $model->find($employee_id);
$brand_id = empty($brand_id) ? get_brand_id() : $brand_id;
if (empty($club)) {
$this->error("员工不存在!");
}
if ($club['brand_id'] != $brand_id) {
$this->error("无权操作此员工!");
}
if ($employee_id == is_user_login()) {
$this->error("无权操作此员工!");
}
return $club;
}
开发者ID:peterleezz,项目名称:test,代码行数:16,代码来源:EmployeeController.class.php
示例20: die
}
}
$sql_select = 'SELECT goods_sn FROM ' . $GLOBALS['ecs']->table('goods_activity') . " WHERE act_id={$activity_id}";
$joined_goods = $GLOBALS['db']->getCol($sql_select);
$smarty->assign('joined_goods', $joined_goods);
$smarty->assign('goods_list', $goods_list);
$smarty->assign('goods_list_div', true);
$smarty->assign('filter', $filter);
$smarty->assign('activity_id', $activity_id);
$res['response_action'] = 'search_service';
$res['main'] = $smarty->fetch('spread_activity_div.htm');
die($json->encode($res));
} elseif ($_REQUEST['act'] == 'set_privilege') {
$privilege = mysql_real_escape_string($_REQUEST['privilege']);
if ($privilege != '') {
$brand_list = get_brand_id();
}
} elseif ($_REQUEST['act'] == 'get_act_goods') {
$act_id = intval($_REQUEST['act_id']);
$res = array('req_msg' => true, 'code' => false);
if ($act_id != 0) {
$sql_select = 'SELECT g.goods_name,g.goods_sn FROM ' . $GLOBALS['ecs']->table('goods_activity') . ' ga,' . $GLOBALS['ecs']->table('goods') . 'g ' . " WHERE ga.goods_sn=g.goods_sn AND ga.act_id={$act_id}";
$goods_list = $GLOBALS['db']->getAll($sql_select);
$sql_select = 'SELECT g.goods_name,gifts_num FROM ' . $GLOBALS['ecs']->table('spread_activity') . ' sa,' . $GLOBALS['ecs']->table('goods') . " g WHERE sa.gifts_sn=g.goods_sn AND sa.activity_id={$act_id}";
$gifts_info = $GLOBALS['db']->getRow($sql_select);
$res['message'] = '<table width=100% cellpadding=0 cellspacing=0>';
if ($goods_list) {
foreach ($goods_list as $val) {
$res['message'] .= "<tr><td>{$val['goods_sn']}</td><td>{$val['goods_name']}</td></tr>";
}
$res['message'] .= "<tr><td colspan=2><font color=red>赠品:</font>{$gifts_info['goods_name']} <font color=red>数量:{$gifts_info['gifts_num']}</font></td></tr></table>";
开发者ID:554119220,项目名称:kjrscrm,代码行数:31,代码来源:performance.php
注:本文中的get_brand_id函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论