当前位置: 首页>>代码示例>>PHP>>正文


PHP getRequestParams函数代码示例

本文整理汇总了PHP中getRequestParams函数的典型用法代码示例。如果您正苦于以下问题:PHP getRequestParams函数的具体用法?PHP getRequestParams怎么用?PHP getRequestParams使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了getRequestParams函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: queryAction

 public function queryAction()
 {
     list($page, $sidx, $limit, $sord, $start) = getRequestParams();
     $condition = array("a.club_id" => get_club_id());
     $filters = I("filters", '', '');
     $filters = json_decode($filters);
     if ($filters->groupOp == 'AND') {
         $rules = $filters->rules;
         foreach ($rules as $key => $value) {
             if ($value->field == "name" && !empty($value->data)) {
                 $condition["a.name"] = array("like", "%{$value->data}%");
             }
             if ($value->field == "phone" && !empty($value->data)) {
                 $condition["a.phone"] = $value->data;
             }
         }
     }
     $model = M("YaaGift");
     $ret = $model->table(array("yoga_yaa_gift" => "b", "yoga_member_basic" => "a"))->where($condition)->where("b.member_id=a.id")->field("a.name,a.sex,b.*")->order("{$sidx} {$sord}")->limit("{$start},{$limit}")->select();
     foreach ($ret as $key => $value) {
         $record_id = $value['record_id'];
         if ($record_id != 0) {
             $ret[$key]['recorder'] = M("UserExtension")->find($record_id);
         }
     }
     $count = $model->table(array("yoga_yaa_gift" => "a", "yoga_member_basic" => "a", "yoga_user_extension" => "c"))->where($condition)->where("a.member_id=b.id")->order(" {$sidx} {$sord}")->limit("{$start},{$limit}")->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,代码行数:34,代码来源:YaaController.class.php

示例2: queryAction

 public function queryAction()
 {
     if (is_user_brand()) {
         $response = array("page" => 0, "total" => 0, "records" => 0, "rows" => null);
         $this->ajaxReturn($response);
     }
     list($page, $sidx, $limit, $sord, $start) = getRequestParams();
     $sidx = preg_replace("/classify.*,/", "", $sidx);
     $sidx = trim($sidx);
     $mcs = D("User")->getMc();
     $arr = array();
     foreach ($mcs as $key => $value) {
         $ret = $this->getOne($value['id']);
         if ($value['group_id'] == 0) {
             $ret['classify'] = "未分组";
         } else {
             $group = D("McGroup")->find($value['group_id']);
             $ret['classify'] = $group['name'];
         }
         $mcs[$key] = array_merge($value, $ret);
     }
     if (empty($sidx) || $sidx == "id") {
         $sidx = "cardsale_all";
         $sord = "desc";
     }
     $function = $sidx . "_" . $sord;
     $f2 = "f2_" . $sidx . "_" . $sord;
     $mcs = $this->sortarr($mcs, $function, $f2);
     $response = array("page" => 0, "total" => 0, "records" => 0, "rows" => $mcs);
     $this->ajaxReturn($response);
 }
开发者ID:peterleezz,项目名称:test,代码行数:31,代码来源:McController.class.php

示例3: queryAction

 public function queryAction()
 {
     $club_id = get_club_id();
     list($page, $sidx, $limit, $sord, $start) = getRequestParams();
     $model = D("PtClassPublic");
     $condition = array("club_id" => $club_id);
     $filters = I("filters", '', '');
     $filters = json_decode($filters);
     if ($filters->groupOp == 'AND') {
         $rules = $filters->rules;
         foreach ($rules as $key => $value) {
             if ($value->field == "name") {
                 $condition = array_merge($condition, array("name" => array("like", "%{$value->data}%")));
             } else {
                 if ($value->field == "pt_id" && $value->data != 0) {
                     $condition = array_merge($condition, array("pt_id" => $value->data));
                 }
             }
         }
     }
     $ret = $model->where($condition)->order("{$sidx} {$sord}")->limit("{$start},{$limit}")->select();
     foreach ($ret as $key => $value) {
         $ret[$key]['image'] = "/Public/uploads/ptclass/" . $value['image'];
     }
     $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,代码行数:33,代码来源:TclassController.class.php

示例4: queryAction

 public function queryAction()
 {
     list($page, $sidx, $limit, $sord, $start) = getRequestParams();
     $model = M("McFollowUp");
     $condition = array("a.club_id" => get_club_id(), "a.ret" => array("gt", 0));
     $filters = I("filters", '', '');
     $filters = json_decode($filters);
     if ($filters->groupOp == 'AND') {
         $rules = $filters->rules;
         foreach ($rules as $key => $value) {
             if ($value->field == "mc_id" && $value->data != -1) {
                 $condition["b.mc_id"] = $value->data;
             }
             if ($value->field == "name" && !empty($value->data)) {
                 $condition["b.name"] = array("like", "%{$value->data}%");
             }
             if ($value->field == "phone" && !empty($value->data)) {
                 $condition["b.phone"] = $value->data;
             }
         }
     }
     $ret = $model->table(array("yoga_mc_follow_up" => "a", "yoga_member_basic" => "b", "yoga_user_extension" => "c"))->where($condition)->where("a.member_id=b.id and b.mc_id=c.id")->field("c.name_cn as mc,b.name,b.sex,b.type,a.is_come,a.come_time,a.appoint_time,a.appoint_time,a.is_come,a.come_time,a.ret,a.id")->order("a.{$sidx} {$sord}")->limit("{$start},{$limit}")->select();
     $count = $model->table(array("yoga_mc_follow_up" => "a", "yoga_member_basic" => "b", "yoga_user_extension" => "c"))->where($condition)->where("a.member_id=b.id and b.mc_id=c.id")->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,代码行数:31,代码来源:InvitController.class.php

示例5: queryfollowupAction

 public function queryfollowupAction()
 {
     list($page, $sidx, $limit, $sord, $start) = getRequestParams();
     $condition = array("club_id" => get_club_id());
     $filters = I("filters", '', '');
     $filters = json_decode($filters);
     $sql = "";
     $setcreate_time = false;
     if ($filters->groupOp == 'AND') {
         $rules = $filters->rules;
         foreach ($rules as $key => $value) {
             if ($value->field == "mc_id" && $value->data != 0) {
                 $condition["mc_id"] = $value->data;
             } else {
                 if ($value->field == "ret" && $value->data != -1) {
                     $condition["ret"] = $value->data;
                 } else {
                     if ($value->field == "create_time" && $value->data != 0 && $value->data != -1) {
                         $setcreate_time = true;
                         $day = $value->data - 1;
                         $time = date('Y-m-d', strtotime("{$day} days ago"));
                         $condition["create_time"] = array("gt", $time);
                     } else {
                         if ($value->field == "start_time" && $value->data != 0) {
                             if (isset($condition['create_time'])) {
                                 if (!$setcreate_time) {
                                     $condition["create_time"] = array("between", $value->data . "," . $condition["create_time"]);
                                 }
                             } else {
                                 $condition["create_time"] = array("gt", $value->data);
                             }
                         } else {
                             if ($value->field == "end_time" && $value->data != 0) {
                                 if (isset($condition['create_time'])) {
                                     if (!$setcreate_time) {
                                         $condition["create_time"] = array("between", $condition["create_time"][1] . "," . $value->data . " 23:59:59");
                                     }
                                 } else {
                                     $condition["create_time"] = array("lt", $value->data . " 23:59:59");
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
     $model = D("McFollowUp");
     $ret = $model->relation(true)->where($condition)->order("{$sidx} {$sord}")->limit("{$start},{$limit}")->select();
     // echo $model->getLastSql();die();
     $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,代码行数:59,代码来源:McsaleController.class.php

示例6: getEmployeesAction

 public function getEmployeesAction()
 {
     list($page, $sidx, $limit, $sord, $start) = getRequestParams();
     $model = M("User");
     $brand_id = get_brand_id();
     $condition = array("brand_id" => $brand_id, "is_brand" => 0);
     $valuesql = "select * from yoga_user a,yoga_user_extension b where a.brand_id={$brand_id} and a.is_brand=0 and a.id=b.id and a.invalid=1 and a.club_id=" . get_club_id() . " ";
     $countsql = "select count(*) as count from yoga_user a,yoga_user_extension b where a.brand_id={$brand_id} and a.is_brand=0 and a.id=b.id and a.invalid=1 and a.club_id=" . get_club_id() . " ";
     $filters = I("filters", '', '');
     $filters = json_decode($filters);
     $sql = "";
     if ($filters->groupOp == 'AND') {
         $rules = $filters->rules;
         foreach ($rules as $key => $value) {
             //  if($value->field=="club"  && $value->data!=0 )
             // {
             // 	$sql.=" and a.club_id ".getOPerationMysql($value->op)."  '{$value->data}'";
             // }
             if ($value->field == "work_status" && $value->data != -1) {
                 $sql .= " and b.work_status " . getOPerationMysql($value->op) . "  '{$value->data}'";
             }
             if ($value->field == "name_cn") {
                 $sql .= " and b.name_cn  like '%{$value->data}%'";
             }
             if ($value->field == "name_en") {
                 $sql .= " and b.name_en  like '%{$value->data}%'";
             }
             if ($value->field == "role" && $value->data != -1) {
                 $ids = M("AuthGroupAccess")->where("group_id=" . $value->data)->select();
                 $id = array();
                 foreach ($ids as $key => $value) {
                     $id[] = $value['uid'];
                 }
                 $ids = implode(",", $id);
                 $sql .= " and b.id in({$ids})";
             }
         }
     }
     $model = new \Think\Model();
     $countsql = $countsql . " " . $sql;
     $count = $model->query($countsql);
     $count = $count[0]["count"];
     $valuesql = $valuesql . " " . $sql . $tail . " order by a.{$sidx} {$sord} limit {$start},{$limit}";
     $ret = $model->query($valuesql);
     foreach ($ret as $key => $value) {
         $ret[$key]['role'] = D("User")->getRole($value['id']);
     }
     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,代码行数:55,代码来源:EmployeeController.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: getPayHistory

 private function getPayHistory($type, $st, $et, $clubs, $sidx, $limit, $sord, $start)
 {
     list($page, $sidx, $limit, $sord, $start) = getRequestParams();
     $payHistoryModel = M("PayHistory");
     $sql = "select b.* from yoga_bill_project a,yoga_pay_history b where a.`sale_club_id` in ({$clubs})  and b.`create_time` between \"{$st}\" and \"{$et}\" and a.`type`={$type} and a.id=b.`bill_project_id` order by {$sidx} {$sord} limit {$start} , {$limit}";
     $list = $payHistoryModel->query($sql);
     $sql = "select count(*) as count from yoga_bill_project a,yoga_pay_history b where a.`sale_club_id` in ({$clubs})  and b.`create_time` between \"{$st}\" and \"{$et}\" and a.`type`={$type} and a.id=b.`bill_project_id`  ";
     $count = $payHistoryModel->query($sql);
     $count = $count[0]['count'];
     return array($count, $list);
 }
开发者ID:peterleezz,项目名称:test,代码行数:11,代码来源:BillService.class.php

示例9: queryPayBackAction

 public function queryPayBackAction()
 {
     $clubs = implode(",", I("club_ids"));
     list($page, $sidx, $limit, $sord, $start) = getRequestParams();
     $service = \Service\CService::factory("Member");
     list($count, $objs) = $service->queryPayBack($clubs, I("start_time"), I("end_time"), $sidx, $limit, $sord, $start);
     if ($count > 0 && $limit > 0) {
         $total_pages = ceil($count / $limit);
     } else {
         $total_pages = 0;
     }
     $response = array("page" => $page, "total" => $total_pages, "records" => $count, "rows" => $objs);
     $this->ajaxReturn($response);
 }
开发者ID:peterleezz,项目名称:test,代码行数:14,代码来源:ContractController.class.php

示例10: 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

示例11: 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

示例12: queryAction

 public function queryAction()
 {
     $club_id = get_club_id();
     $pts = D("User")->getPt();
     $arr = array();
     foreach ($pts as $key => $value) {
         $arr[] = $value['id'];
     }
     list($page, $sidx, $limit, $sord, $start) = getRequestParams();
     $model = D("PtClassPublic");
     if (!empty($arr)) {
         $condition = array("pt_id" => array("in", $arr));
     }
     $condition[] = array("club_id" => $club_id);
     $condition['_logic'] = 'or';
     $map['_complex'] = $condition;
     $filters = I("filters", '', '');
     $filters = json_decode($filters);
     if ($filters->groupOp == 'AND') {
         $rules = $filters->rules;
         foreach ($rules as $key => $value) {
             if ($value->field == "name") {
                 $v = $value->data;
                 $map = array_merge($map, array("_string" => "name like '%{$v}%' or teacher_name like '%{$v}%'"));
                 // $map = array_merge($map,array("name"=>array("like","%{$value->data}%")) );
             }
         }
     }
     $ret = $model->where($map)->order("{$sidx} {$sord}")->limit("{$start},{$limit}")->select();
     foreach ($ret as $key => $value) {
         if (!empty($value['teacher_name'])) {
             $ret[$key]['teacher'] = $value['teacher_name'];
         } else {
             $teacher = M("UserExtension")->find($value['pt_id']);
             $ret[$key]['teacher'] = $teacher['name_cn'];
         }
     }
     $count = $model->where($map)->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,代码行数:46,代码来源:ClassController.class.php

示例13: getMcs

 public function getMcs()
 {
     list($page, $sidx, $limit, $sord, $start) = getRequestParams();
     $club_id = empty($club_id) ? get_club_id() : $club_id;
     $where = "a.id=b.id and a.id=c.uid and b.club_id={$club_id} and c.group_id=6";
     $filters = I("filters", '', '');
     $filters = json_decode($filters);
     $sql = "";
     if ($filters->groupOp == 'AND') {
         $rules = $filters->rules;
         foreach ($rules as $key => $value) {
             if ($value->field == "name" && !empty($value->data)) {
                 $name = $value->data;
                 $where .= " and (a.name_cn like '%{$name}%' or a.name_en like '%{$name}%')";
             }
         }
     }
     $mcs = M()->where($where)->table(array("yoga_user_extension" => "a", "yoga_user" => "b", "yoga_auth_group_access" => "c"))->field("a.id,a.name_cn,a.group_id,a.work_status")->order("a.group_id")->limit("{$offset},{$num}")->select();
     foreach ($mcs as $key => $value) {
         if ($value['work_status'] == 1) {
             $group = array("name" => "离职");
             $mcs[$key]['group'] = $group;
         } else {
             if ($value['group_id'] != 0) {
                 $group = $this->find($value['group_id']);
                 $mcs[$key]['group'] = $group;
             } else {
                 $mcs[$key]['group'] = null;
             }
         }
     }
     $count = D("User")->getMcCount();
     if ($count > 0 && $limit > 0) {
         $total_pages = ceil($count / $limit);
     } else {
         $total_pages = 0;
     }
     $response = array("page" => $page, "total" => $total_pages, "records" => $count, "rows" => $mcs);
     return $response;
 }
开发者ID:peterleezz,项目名称:test,代码行数:40,代码来源:McGroupModel.class.php

示例14: 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

示例15: queryConsumeAction

 public function queryConsumeAction()
 {
     $service = \Service\CService::factory("Member");
     list($page, $sidx, $limit, $sord, $start) = getRequestParams();
     $condition = array("brand_id" => get_brand_id());
     $filters = I("filters", '', '');
     $filters = json_decode($filters);
     if ($filters->groupOp == 'AND') {
         $rules = $filters->rules;
         $name = "";
         $phone = "";
         foreach ($rules as $key => $value) {
             if ($value->field == "club_id" && $value->data != -1) {
                 $condition["club_id"] = $value->data;
             } else {
                 if ($value->field == "name") {
                     $name = $value->data;
                 } else {
                     if ($value->field == "phone") {
                         $phone = $value->data;
                     } else {
                         if ($value->field == "contract_number") {
                             $contract = M("Contract")->where(array("contract_number" => $value->data))->find();
                             if (empty($contract)) {
                                 $response = array("page" => 0, "total" => 0, "records" => 0, "rows" => null);
                                 $this->ajaxReturn($response);
                             }
                             $condition["contract_id"] = $contract['id'];
                         } else {
                             if ($value->field == "card_number") {
                                 $card = M("Card")->where(array("card_number" => $value->data))->find();
                                 if (empty($card)) {
                                     $response = array("page" => 0, "total" => 0, "records" => 0, "rows" => null);
                                     $this->ajaxReturn($response);
                                 }
                                 $condition["card_id"] = $card['id'];
                             }
                         }
                     }
                 }
             }
         }
         if (!empty($name) || !empty($phone)) {
             $members = $service->getMemberByBrand(get_brand_id(), $name, $phone);
             if (empty($members)) {
                 $response = array("page" => 0, "total" => 0, "records" => 0, "rows" => null);
                 $this->ajaxReturn($response);
             }
             $ids = "";
             foreach ($members as $k => $v) {
                 if ($k != 0) {
                     $ids .= ",";
                 }
                 $ids .= $v['id'];
             }
             $condition["member_id"] = array("in", $ids);
         }
     }
     $model = D("CheckHistory");
     $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,代码行数:69,代码来源:ReviewController.class.php


注:本文中的getRequestParams函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。