本文整理汇总了PHP中get_club_id函数的典型用法代码示例。如果您正苦于以下问题:PHP get_club_id函数的具体用法?PHP get_club_id怎么用?PHP get_club_id使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_club_id函数的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);
}
示例2: getAllCanSaleGoods
public function getAllCanSaleGoods($club_id = null)
{
$club_id = empty($club_id) ? get_club_id() : $club_id;
$timenow = date("Y-m-d");
$sql = "SELECT b.* FROM yoga_goods_club a,yoga_goods b where a.club_id={$club_id} and a.goods_id = b.id and b.status!=0";
return $this->query($sql);
}
示例3: 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);
}
示例4: queryAction
public function queryAction()
{
$uid = is_user_login();
list($page, $sidx, $limit, $sord, $start) = getRequestParams();
$model = D("ClubClassroom");
$condition = array("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") {
$condition = array_merge($condition, array("name" => array("like", "%{$value->data}%")));
}
}
}
$ret = $model->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);
}
示例5: getMonthStatistics
public function getMonthStatistics($club_id, $start_time, $end_time)
{
$start_time = $start_time . "-00 00:00:00";
$end_time = $end_time . "-31 23:59:59";
$club_id = empty($club_id) ? get_club_id() : $club_id;
$ret = M("ChannelAllStatistics")->where(array("time" => array("between", "{$start_time},{$end_time}"), "club_id" => $club_id))->order("time desc")->select();
$model = M("MemberBasic");
$channelModel = M("Channel");
foreach ($ret as $key => $value) {
$time = $value["time"];
$time = substr($time, 0, 7);
$ret[$key]['time'] = $time;
$start_time = $time . "-00 00:00:00";
$end_time = $time . "-31 23:59:59";
$value = $this->getClubtTotal($start_time, $end_time, $club_id);
$ret[$key]["protential_value"] = $value["protential_total"];
$ret[$key]["transform_value"] = $value["transform_total"];
$ret[$key]["channel_value"] = $value["channel_total"];
$total = $this->getClubtTotal('0000-00-00 00:00:00', $end_time, $club_id);
$ret[$key]["protential_total"] = $total['protential_total'];
$ret[$key]["transform_total"] = $total['transform_total'];
$ret[$key]["channel_total"] = $total['channel_total'];
}
return $ret;
}
示例6: getCanSaleCards
public function getCanSaleCards($club_id = null)
{
$club_id = empty($club_id) ? get_club_id() : $club_id;
$timenow = date("Y-m-d");
$sql = "SELECT b.* FROM yoga_card_saleclub a,yoga_card_type b where a.club_id={$club_id} and a.card_type_id = b.id and b.start_time <='{$timenow}' and b.end_time >= '{$timenow}' and b.status!=0";
return $this->query($sql);
}
示例7: getAllCanSaleClasses
public function getAllCanSaleClasses($club_id = null)
{
$club_id = empty($club_id) ? get_club_id() : $club_id;
$timenow = date("Y-m-d");
$sql = "SELECT b.* FROM yoga_pt_club a,yoga_pt_class b where `a`.`club_id`={$club_id} and `a`.`pt_class_id` = `b`.`id` and `b`.`status`!=0";
return $this->query($sql);
}
示例8: getCanUseCards
public function getCanUseCards($club_id = null)
{
$club_id = empty($club_id) ? get_club_id() : $club_id;
$timenow = date("Y-m-d");
$sql = "SELECT b.* FROM yoga_card_useclub a,yoga_card_type b where a.club_id={$club_id} and a.card_type_id = b.id";
return $this->query($sql);
}
示例9: paybackdetailAction
public function paybackdetailAction($id)
{
$service = \Service\CService::factory("Financial");
$bill = $service->getBillProject("0,3,4,5", $id);
$this->assign("bill", $bill);
$contract = D('Contract')->relation('card_type')->find($id);
$member_id = $contract['member_id'];
$member = M('MemberBasic')->find($member_id);
$this->assign("member", $member);
$this->assign("contract", $contract);
$useClubs = D("CardUseclub")->getAllUseClub($contract['card_type']['id']);
$clubs = "";
foreach ($useClubs as $key => $value) {
if ($key != 0) {
$clubs .= "、";
}
$clubs .= $value['club_name'];
}
$this->assign("useClubs", $clubs);
//pasy history
list($history, $count) = $service->getPayHistoryByBillId($id, 0, 999);
$this->assign("history", $history);
//all cardtypes that can upgrade to
$card_type = $card['card_type'];
$cardtypes = D("CardType")->getAllCanUpgrade($contract['start_time'], $contract['card_type']['id']);
$this->assign("typesarr", json_encode($cardtypes));
$this->assign("cardtypes", $cardtypes);
$this->assign("current_contract", json_encode($contract));
$club = M("Club")->find(get_club_id());
$this->assign("club", $club);
$this->assign("print_time", date('Y-m-d H:i:s'));
$this->display();
}
示例10: 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);
}
示例11: getAllContract
public function getAllContract($member_id, $club_id = null)
{
if (empty($club_id)) {
$club_id = get_club_id();
}
$ret = $this->relation(true)->where(array("member_id" => $member_id, "club_id" => $club_id))->order("start_time asc")->select();
return $ret;
}
示例12: 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);
}
示例13: getOne
public function getOne($mc_id)
{
$club_id = get_club_id();
//当日潜客
$potential_d = McNewService::getInstance()->getTodayPotentialNumber($mc_id);
$potential_all = McNewService::getInstance()->getAllPotentialNumber($mc_id);
//成交额
$cardsale_d = McNewService::getInstance()->getTodayCardsSale($mc_id);
$cardsale_all = McNewService::getInstance()->getAllCardsSale($mc_id);
return array("potential_d" => $potential_d, "potential_all" => $potential_all, "cardsale_d" => $cardsale_d, "cardsale_all" => $cardsale_all);
}
示例14: indexAction
public function indexAction()
{
if (is_user_login()) {
if (get_club_id() != 0 || get_brand_id() != 0) {
$this->redirect('Home/Main/main');
} else {
$this->redirect('Home/Main/main');
}
// $this->redirect('Home/Main/teacher');
}
$this->display();
}
示例15: 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}"));
}