本文整理汇总了PHP中getRequestParams函数的典型用法代码示例。如果您正苦于以下问题:PHP getRequestParams函数的具体用法?PHP getRequestParams怎么用?PHP getRequestParams使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getRequestParams函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: queryReportAction
public function queryReportAction()
{
list($page, $sidx, $limit, $sord, $start) = getRequestParams();
$filters = I("filters", '', '');
$filters = json_decode($filters);
$rules = $filters->rules;
foreach ($rules as $key => $value) {
if ($value->field == "club_ids") {
$clubs = $value->data;
} else {
if ($value->field == "pay_id") {
$pay_id = $value->data;
} else {
if ($value->field == "type") {
$type = $value->data;
} else {
if ($value->field == "start_time") {
$start_time = $value->data;
} else {
if ($value->field == "end_time") {
$end_time = $value->data;
}
}
}
}
}
}
switch ($type) {
case '1':
//day
if (empty($start_time)) {
$this->error("请输入开始时间!");
}
$st = $start_time . " 00:00:00";
$et = $start_time . " 23:59:59";
break;
case '2':
//month
if (empty($start_time)) {
$this->error("请输入开始时间!");
}
$st = $start_time . "-01 00:00:00";
$et = $start_time . "-31 23:59:59";
break;
case '3':
//year
if (empty($start_time)) {
$this->error("请输入开始时间!");
}
$st = $start_time . "-01-01 00:00:00";
$et = $start_time . "-12-31 23:59:59";
break;
case '4':
//other
if (empty($start_time)) {
$this->error("请输入开始时间!");
}
if (empty($end_time)) {
$this->error("请输入结束时间!");
}
$st = $start_time;
$et = $end_time;
break;
default:
# code...
break;
}
$condition = array("club_id" => array("in", $clubs), "create_time" => array("between", "{$st},{$et}"));
if (!empty($pay_id)) {
$condition = array("id" => $pay_id);
}
$model = D("PayHistory");
$bill_project = $model->relation(true)->where($condition)->order("{$sidx} {$sord}")->limit("{$start},{$limit}")->select();
foreach ($bill_project as $key => $value) {
$bill_project[$key]['member'] = M("MemberBasic")->find($value['bill']['member_id']);
}
$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" => $bill_project);
$this->ajaxReturn($response);
}
开发者ID:peterleezz,项目名称:test,代码行数:85,代码来源:PayhistoryController.class.php
示例17: foreach
$postfix = "";
$isFirst = true;
foreach ($mpds as $index => $response) {
$adaptationSetStartPos = strpos($response, AdaptationSetStartTag);
$adaptationSetEndPos = strpos($response, AdaptationSetEndTag);
if ($isFirst) {
$prefix = substr($response, 0, $adaptationSetStartPos);
$postfix = substr($response, $adaptationSetEndPos + strlen(AdaptationSetEndTag));
$isFirst = false;
}
$output = $output . substr($response, $adaptationSetStartPos, $adaptationSetEndPos - $adaptationSetStartPos + strlen(AdaptationSetEndTag));
}
$output = $prefix . $output . $postfix;
return $output;
}
$params = getRequestParams();
$fileName = $params['file'];
$arr = array();
if ($fileName == 'strip') {
$content = getContent("http://lbd.kaltura.com:8001/mapped/strip.json/manifest.mpd");
$content = str_replace('id="1"', 'group="1"', $content);
$arr[] = $content;
for ($i = 0; $i < 5; $i++) {
$content = getContent("http://lbd.kaltura.com:8001/mapped/aud-{$i}.json/manifest.mpd");
$adaptAttrs = 'group="' . ($i + 2) . '"' . "\n";
$adaptAttrs .= ' lang="en_vid' . $i . '"';
$content = str_replace('id="2"', $adaptAttrs, $content);
$arr[] = $content;
}
} else {
$arr[] = getContent("http://lbd.kaltura.com:8001/mapped/vid-{$fileName}.json/manifest.mpd");
开发者ID:kaltura,项目名称:zapit,代码行数:31,代码来源:merge_manifest.php
示例18: verifyRequiredParams
/**
* Verifying required params posted or not
*/
function verifyRequiredParams($required_fields)
{
$error = false;
$error_fields = "";
$request_params = getRequestParams();
foreach ($required_fields as $field) {
if (!isset($request_params[$field]) || strlen(trim($request_params[$field])) <= 0) {
$error = true;
$error_fields .= $field . ', ';
}
}
if ($error) {
// Required field(s) are missing or empty
// echo error json and stop the app
$message = 'Required field(s) ' . substr($error_fields, 0, -2) . ' is missing';
exitApp(BAD_REQUEST, $message);
}
}
开发者ID:saiful15,项目名称:REST-in-SlimFramework,代码行数:21,代码来源:Auth.php
示例19: queryAction
public function queryAction()
{
list($page, $sidx, $limit, $sord, $start) = getRequestParams();
$filters = I("filters", '', '');
$brand_id = get_brand_id();
$club_id = get_club_id();
$valuesql = "select b.*,a.name,a.sex,a.phone ,c.card_number ,d.name as card_name,d.type as card_type ,d.price as card_type_price from yoga_contract b left join yoga_member_basic a on b.member_id=a.id left join yoga_card c on b.card_id=c.id left join yoga_card_type d on b.card_type_id=d.id where b.brand_id= {$brand_id} ";
$countsql = "select count(*) as count from yoga_contract b left join yoga_member_basic a on b.member_id=a.id left join yoga_card c on b.card_id=c.id left join yoga_card_type d on b.card_type_id=d.id where b.brand_id= {$brand_id} ";
$filters = json_decode($filters);
$sql = "";
if ($filters->groupOp == 'AND') {
$rules = $filters->rules;
foreach ($rules as $key => $value) {
if ($value->field == "mc_id" && !empty($value->data)) {
$sql .= " and b.mc_id " . getOPerationMysql($value->op) . " '{$value->data}'";
}
if ($value->field == "sale_club_id" && !empty($value->data)) {
$sql .= " and b.sale_club_id " . getOPerationMysql($value->op) . " '{$value->data}'";
}
if ($value->field == "start_time" && !empty($value->data)) {
$sql .= " and b.create_time " . getOPerationMysql($value->op) . " '{$value->data}'";
}
if ($value->field == "end_time" && !empty($value->data)) {
$sql .= " and b.create_time " . getOPerationMysql($value->op) . " '{$value->data}'";
}
if ($value->field == "card_type_id" && !empty($value->data)) {
$sql .= " and b.card_type_id " . getOPerationMysql($value->op) . &q
|
请发表评论