static public function Login($user_id=0) { global $INI; if ($INI['credit']['login']==0) return ; $now = Time() - 86400; $condition = array( 'user_id' => $user_id, 'action' => 'login', "create_time > $now", ); $count = Table::Count('credit', $condition); if ($count>0) return; self::Create($INI['credit']['login'], $user_id, 'login'); }
static function Assign($order) { $ccon = array('order_id' => $order['id']); $count = Table::Count('voucher', $ccon); while ($count < $order['quantity']) { $voucher = self::GetValidVoucher($order['team_id']); if (!$voucher) { break; } Table::UpdateCache('voucher', $voucher['id'], array('user_id' => $order['user_id'], 'order_id' => $order['id'])); $count = Table::Count('voucher', $ccon); } }
public static function Create($order) { $team = Table::Fetch('team', $order['team_id']); $partner = Table::Fetch('partner', $order['partner_id']); $ccon = array('order_id' => $order['id']); $count = Table::Count('coupon', $ccon); while ($count < $order['quantity']) { $id = Utility::GenSecret(8, Utility::CHAR_NUM); $cv = Table::Fetch('coupon', $id); if ($cv) { continue; } $coupon = array('id' => $id, 'user_id' => $order['user_id'], 'partner_id' => $team['partner_id'], 'order_id' => $order['id'], 'credit' => $team['credit'], 'team_id' => $order['team_id'], 'secret' => Utility::GenSecret(6, Utility::CHAR_WORD), 'expire_time' => $team['expire_time'], 'create_time' => time()); DB::Insert('coupon', $coupon); sms_coupon($coupon); $count = Table::Count('coupon', $ccon); } }
public static function Create($order) { if ($order['state'] == 'unpay') { return; } $team = Table::Fetch('team', $order['team_id']); $partner = Table::Fetch('partner', $order['partner_id']); $ccon = array('order_id' => $order['id']); $count = Table::Count('coupon', $ccon); while ($count < $order['quantity']) { $id = Utility::GenSecret(12, Utility::CHAR_NUM); $cv = Table::Fetch('coupon', $id); $coupon = array('id' => Utility::GenSecret(12, Utility::CHAR_NUM), 'user_id' => $order['user_id'], 'partner_id' => $team['partner_id'], 'order_id' => $order['id'], 'credit' => $team['credit'], 'team_id' => $order['team_id'], 'secret' => Utility::GenSecret(8, Utility::CHAR_WORD), 'expire_time' => $team['expire_time'], 'create_time' => time()); DB::Insert('coupon', $coupon); $count = Table::Count('coupon', $ccon); $user = Table::Fetch('user', $order['user_id']); mail_coupon($team, $partner, $order, $user, $coupon); } }
public static function Create($order) { $team = Table::Fetch('team', $order['team_id']); //$partner = Table::Fetch('partner', $order['partner_id']); $ccon = array('order_id' => $order['id']); $count = Table::Count('code', $ccon); require dirname(dirname(dirname(__FILE__))) . "/zhongyu/Zhongyu.class.php"; $zhongyu = new Zhongyu(); while ($count < $order['quantity']) { $id = date('YmdHis', time()) . rand(100000, 999999); $id = Utility::VerifyCode($id); $cv = Table::Fetch('code', $id); if ($cv) { continue; } /* 这里请求第三方发码接口 */ if ('zhongyu' == $team['codeform']) { //判断为中娱发码方式 $codeform = 'zhongyu'; $info = array('req_seq' => $id, 'serv_code' => $team['serv_code'], 'phone_rece' => $order['mobile'], 'notes' => ''); $result = $zhongyu->send($info); //print_r($result);exit; $doc = new DOMDocument(); $doc->loadXML($result); $response_id = $doc->getElementsByTagName("id")->item(0)->nodeValue; if ('0000' == $response_id) { //成功 $sys_seq = $doc->getElementsByTagName("order_num")->item(0)->nodeValue; $msg = $doc->getElementsByTagName("comment")->item(0)->nodeValue; $mms = 1; } else { //失败 $msg = $doc->getElementsByTagName("comment")->item(0)->nodeValue; $mms = 0; } } $code = array('id' => $id, 'sys_seq' => $sys_seq, 'user_id' => $order['user_id'], 'partner_id' => $team['partner_id'], 'city_id' => $team['city_id'], 'order_id' => $order['id'], 'team_id' => $order['team_id'], 'expire_time' => $team['expire_time'], 'create_time' => time(), 'msg' => $msg, 'mms' => $mms, 'codeform' => $codeform); if (DB::Insert('code', $code)) { //sms_coupon($coupon); $count = Table::Count('code', $ccon); } } }
static function Assign($order) { $ccon = array('order_id' => $order['id']); $count = Table::Count('voucher', $ccon); //send_goods_confirm_by_platform if( ($order['service']=='alipay') && ($INI['alipay']['autosendgoods']='Y') && ($INI['alipay']['guarantee']!='Y') ) { alipay_send_goods($order['trade_no']); } while($count<$order['quantity']) { $voucher = self::GetValidVoucher($order['team_id']); if (!$voucher) break; $flag = Table::UpdateCache('voucher', $voucher['id'], array( 'user_id' => $order['user_id'], 'order_id' => $order['id'], )); if($flag){ $voucher = Table::Fetch('voucher', $voucher['id']); global $INI; if ($INI['sms']['auto']=='1') sms_voucher($voucher); } $count = Table::Count('voucher', $ccon); } }
static public function Create($order) { $team = Table::Fetch('team', $order['team_id']); $partner = Table::Fetch('partner', $order['partner_id']); $ccon = array('order_id' => $order['id']); $count = Table::Count('coupon', $ccon); while($count<$order['quantity']) { /* 配合400验证,ID统一修改为12位伪随机数字,密码为6位数字 */ $id = (ceil(time()/100)+rand(10000000,20000000)); $id = Utility::VerifyCode($id); $cv = Table::Fetch('coupon', $id); if ($cv) continue; $coupon = array( 'id' => $id, 'user_id' => $order['user_id'], 'buy_id' => $order['buy_id'], 'partner_id' => $team['partner_id'], 'order_id' => $order['id'], 'credit' => $team['credit'], 'team_id' => $order['team_id'], 'secret' => Utility::VerifyCode(Utility::GenSecret(6, Utility::CHAR_NUM)), 'expire_time' => $team['expire_time'], 'create_time' => time(), ); DB::Insert('coupon', $coupon); $count = Table::Count('coupon', $ccon); //send_goods_confirm_by_platform /** if( ($order['service']=='alipay') && ($INI['alipay']['autosendgoods']='Y') && ($INI['alipay']['guarantee']!='Y') ) { alipay_send_goods($order['trade_no']); } */ } sms_all_coupon($order); }
$e[$k]['price'] = $team["express_price_{$v}"]; } $team['express_relate'] = serialize($e); //team_type == goods if($team['team_type'] == 'goods'){ $team['min_number'] = 1; $team['conduser'] = '******'; } if ( !$id ) { $team['now_number'] = $team['pre_number']; } else { $field = strtoupper($table->conduser)=='Y' ? null : 'quantity'; $now_number = Table::Count('order', array( 'team_id' => $id, 'state' => 'pay', ), $field); $team['now_number'] = ($now_number + $team['pre_number']); /* 增加了总数,未卖完状态 */ if ( $team['max_number'] > $team['now_number'] ) { $team['close_time'] = 0; $insert[] = 'close_time'; } /* update coupon */ DB::Update('coupon', array('team_id' => $id), array( 'expire_time' => $team['expire_time'], )); /* update order */ DB::Update('order', array('team_id' => $id), array(
public static function Address($user_id, $address) { if (!$user_id || !is_array($address)) { return false; } $count = Table::Count('address', array('user_id' => $user_id)); $default = $count == 0 ? 'Y' : 'N'; if ($count > 10) { return false; } $add = array('user_id' => $user_id, 'province' => $address['province'], 'area' => $address['area'], 'city' => $address['city'], 'street' => $address['street'], 'zipcode' => $address['zipcode'], 'name' => $address['name'], 'mobile' => $address['mobile'], 'default' => $default, 'create_time' => time()); return DB::Insert('address', $add); }
<?php require_once dirname(dirname(dirname(__FILE__))) . '/app.php'; need_manager(); need_auth('market'); $like = strval($_GET['like']); $cs = strval($_GET['cs']); /* build condition */ $condition = array(); if ($like) { $condition[] = "email like '%" . mysql_escape_string($like) . "%'"; } if ($cs) { $cscity = DB::LimitQuery('category', array('condition' => array('zone' => 'city', 'name' => $cs), 'one' => true)); if ($cscity) { $condition['city_id'] = $cscity['id']; } else { $cs = null; } } /* end */ $count = Table::Count('subscribe', $condition); list($pagesize, $offset, $pagestring) = pagestring($count, 50); $subscribes = DB::LimitQuery('subscribe', array('condition' => $condition, 'order' => 'ORDER BY id DESC', 'size' => $pagesize, 'offset' => $offset)); $city_ids = Utility::GetColumn($subscribes, 'city_id'); $cities = Table::Fetch('category', $city_ids); include template('manage_misc_subscribe');
} if (preg_match('#/city#', $_SERVER['HTTP_REFERER'])) { redirect( 'index.php'); } redirect($_SERVER['HTTP_REFERER']); } redirect('index.php'); } } $cities = DB::LimitQuery('category', array( 'condition' => array( 'zone' => 'city') , )); foreach($cities as &$c){ $daytime = time(); $condition = array( 'city_id' => array(0, abs(intval($c['id']))), "begin_time < {$daytime}", "end_time > {$daytime}", ); $c['team_num'] = Table::Count('team',$condition); } $cities = Utility::AssColumn($cities, 'letter', 'ename'); ksort($cities); $pagetitle = '城市选择'; include template('m_city');
<?php /** * My * ---------------------------------------------------------------------------- * This is not free software * ---------------------------------------------------------------------------- * @author abei <*****@*****.**> * @version 1.0 * @link http://www.qiang8.cn */ require_once(dirname(dirname(__FILE__)) . '/app.php'); need_login(true); $consume_times = Table::Count('order', array( 'user_id' => $login_user_id, 'state' => 'pay', )); die(include template('m_my'));
)); $join_number = 0; foreach($teams_other AS $k=>$one){ $join_number += $one['now_number']; } //今日新品判断 if($ncon == 'new'){ $condition[] = "begin_time >= '{$daytime}'"; } if($sid) $condition['sub_id'] = $sid; if($cid) $condition[] = "((city_ids like '%@{$cid}@%' or city_ids like '%@0@%') or city_id in(0,{$cid}))"; if ($group_id) $condition['group_id'] = $group_id; $count = Table::Count('team', $condition); list($pagesize, $offset, $pagestring) = pagestring($count, 100); $teams = DB::LimitQuery('team', array( 'condition' => $condition, 'order' => 'ORDER BY ' . $order . ' now_number DESC', 'size' => $pagesize, 'offset' => $offset, )); //判断是否卖光了 foreach($teams AS $id=>$one){ team_state($one); if (!$one['close_time']) $one['picclass'] = 'isopen'; if ($one['state']=='soldout') $one['picclass'] = 'soldout'; $teams[$id] = $one; }
$tcount = Table::Count('team', array('city_id' => $id)); if ($tcount) { json('本类下存在团购项目', 'alert'); } } elseif ($category['zone'] == 'group') { $tcount = Table::Count('team', array('group_id' => $id)); if ($tcount) { json('本类下存在团购项目', 'alert'); } } elseif ($category['zone'] == 'express') { $tcount = Table::Count('order', array('express_id' => $id)); if ($tcount) { json('本类下存在订单项目', 'alert'); } } elseif ($category['zone'] == 'public') { $tcount = Table::Count('topic', array('public_id' => $id)); if ($tcount) { json('本类下存在讨论区话题', 'alert'); } } Table::Delete('category', $id); option_category($category['zone']); Session::Set('notice', '删除分类成功'); json(null, 'refresh'); } else { if ('teamcoupon' == $action) { need_auth('team'); $team = Table::Fetch('team', $id); team_state($team); if ($team['now_number'] < $team['min_number']) { json('团购未结束或未达到最低成团人数', 'alert');
)); //buyonce if (strtoupper($team['buyonce'])=='Y') { $ex_con['state'] = 'pay'; if ( Table::Count('order', $ex_con) ) { Session::Set('error', '您已经成功购买了本单产品,请勿重复购买,快去关注一下其他产品吧!'); redirect( "index.php"); } } //peruser buy count if ($team['per_number']>0) { $now_count = Table::Count('order', array( 'user_id' => $login_user_id, 'team_id' => $id, 'state' => 'pay', ), 'quantity'); $team['per_number'] -= $now_count; if ($team['per_number']<=0) { Session::Set('error', '您购买本单产品的数量已经达到上限,快去关注一下其他产品吧!'); redirect( 'now.php' ); } } //post buy if ( $_POST ) { need_login(true); $express_id = (int) $_POST['express_id']; if($team['delivery'] == 'express'){ foreach ($express_ralate as $k=>$v) {
<?php require_once dirname(dirname(dirname(__FILE__))) . '/app.php'; need_manager(); $condition = array(); /* filter */ $ptitle = strval($_GET['ptitle']); if ($ptitle) { $condition[] = "title LIKE '%" . mysql_escape_string($ptitle) . "%'"; } /* filter end */ $count = Table::Count('partner', $condition); list($pagesize, $offset, $pagestring) = pagestring($count, 20); $partners = DB::LimitQuery('partner', array('condition' => $condition, 'order' => 'ORDER BY id DESC', 'size' => $pagesize, 'offset' => $offset)); include template('manage_partner_index');
} /* end fiter */ $count_ask = Table::Count('apply', array('type' => 'askrefund','status' => 'ask')); $count_do = Table::Count('apply', array('type' => 'askrefund','status' => 'do')); $count_be = Table::Count('apply', array('type' => 'askrefund','status' => 'be')); $count_no = Table::Count('apply', array('type' => 'askrefund','status' => 'no')); $count_cancel = Table::Count('apply', array('type' => 'askrefund','status' => 'cancel')); $summary = Table::Count('apply', $condition, 'remoney'); $count = Table::Count('apply', $condition); list($pagesize, $offset, $pagestring) = pagestring($count, 20); $applys = DB::LimitQuery('apply', array( 'condition' => $condition, 'order' => 'ORDER BY create_time DESC', 'size' => $pagesize, 'offset' => $offset, )); $option_reasons = array( '商家说可以直接以团购价到店消费' => '商家说可以直接以团购价到店消费', '预约不上' => '预约不上', '去过了,不太满意' => '去过了,不太满意', '朋友/网上评价不好' => '朋友/网上评价不好', '买多了/买错了' => '买多了/买错了',
<?php require_once dirname(dirname(dirname(__FILE__))) . '/app.php'; if (!need_manager()) { need_permission('access', 'misc/invite'); } $memail = strval($_GET['memail']); $oemail = strval($_GET['oemail']); $condition = array('credit > 0', 'pay' => 'N'); if ($memail) { $muser = Table::Fetch('user', $memail, 'email'); if ($muser) { $condition['user_id'] = $muser['id']; } } if ($oemail) { $ouser = Table::Fetch('user', $oemail, 'email'); if ($ouser) { $condition['other_user_id'] = $ouser['id']; } } $count = Table::Count('invite', $condition); list($pagesize, $offset, $pagestring) = pagestring($count, 20); $invites = DB::LimitQuery('invite', array('condition' => $condition, 'order' => 'ORDER BY id DESC', 'size' => $pagesize, 'offset' => $offset)); $team_ids = Utility::GetColumn($invites, 'team_id'); $teams = Table::Fetch('team', $team_ids); $user_ids = Utility::GetColumn($invites, 'user_id'); $user_ido = Utility::GetColumn($invites, 'other_user_id'); $user_ids = array_merge($user_ids, $user_ido); $users = Table::Fetch('user', $user_ids); include template('manage_misc_invite');
$team = Table::Fetch('team', $coupon['team_id']); Session::Set('notice-ok', '<div class=yzcg style= margin-bottom:8px><b>验证成功!</b></div>' . '<div class=ts><span>优券密码:</span>' . $coupon['id'] . '</div>' . '<div class=ts><span>验证时间:</span>' . date('Y-m-d H:i:s', time()) . '</div>' . '<div class=ts><span>项目名称:</span>' . '<a target=_blank href=http://www.milituan.net/team/' . $coupon['team_id'] . '.html>' . $team['product'] . '</a>' . '</div>'); $status = "OK"; } } } } $data = date('Y-m-d H:i:s') . " - " . $login_partner['username'] . " - " . $ruian . " - " . $status; file_put_contents(DIR_CONFIGURE . '/consume.log', $data . "\n", FILE_APPEND); } /** * Recent record / num 5 * @author abei <*****@*****.**> * @version 20131026 */ $now = time(); $list_condition['consume'] = 'Y'; $list_condition[] = "`consume_time` < " . $now . " AND `consume_time` > " . ($now - 86400); if ($login_partner['fid'] == 0) { // i am father $list_condition['partner_id'] = $login_partner['id']; } else { // i am stroe $list_condition['store_id'] = $login_partner['store_id']; } $count = Table::Count('coupon', $list_condition); list($pagesize, $offset, $pagestring) = pagestring($count, 10); $couponList = DB::LimitQuery('coupon', array('condition' => $list_condition, 'order' => 'ORDER BY consume_time DESC', 'size' => $pagesize, 'offset' => $offset)); $partner_ids = Utility::GetColumn($couponList, 'doer_id'); $partners = Table::Fetch('partner', $partner_ids); include template('biz_consume');
$msg .= "false& 对不起,暂时没有任何抽奖信息!"; }else{ if ($lottery['dateline']>$daytime){ $msg = "false& 抽奖活动尚未开始!\n开始时间:".date('Y-m-d H:i',$lottery['dateline']); }else{ $count = $lottery['count']; //参与抽奖的剩余数量 $condition = array( 'team_id' => $lottery['teamid'], 'is_lottery' => 0, ); $count1 = Table::Count('coupon', $condition); //已经中奖者数量 $winning = array( 'teamid' => $lottery['teamid'], ); $count2 = Table::Count('lottery_list', $winning); if ($count==$count2){ $msg .= "false& 对不起,本次抽奖的中奖者已经达到设定值<b>".$count."</b>名!抽奖活动已结束"; }else{ $msg .= $lottery['teamid']."&".$count."&".$lottery['title']."&".$count1."&".$count2; } } } //数组说明 0:$lottery['teamid']=>项目ID 1:$count=>设定的中奖数量 2:$lottery['title']=>项目名称 3:$count1=>剩余抽奖人数 4:$count2=>已经中奖人数 echo $msg; ?>
<?php require_once dirname(dirname(dirname(__FILE__))) . '/app.php'; if (!need_manager()) { need_permission('access', 'customer/index'); } $like = strval($_GET['like']); $cs = strval($_GET['cs']); $usergroup = Table::Fetch('user_group', 'customer', 'name'); /* build condition */ //$condition = array(); if ($like) { if (empty($usergroup)) { $condition = array('user_group_id' => 0, "email like '%" . mysql_escape_string($like) . "%'"); } else { $condition = array('or' => array('and' => array('user_group_id' => 0, "email like '%" . mysql_escape_string($like) . "%'"), 'user_group_id' => $usergroup['id']), "email like '%" . mysql_escape_string($like) . "%'"); } } else { if (empty($usergroup)) { $condition = array('user_group_id' => 0); } else { $condition = array('or' => array('and' => array('user_group_id' => 0, "1=1"), 'user_group_id' => $usergroup['id'])); } } $condition[] = "manager='N'"; $count = Table::Count('user', $condition); list($pagesize, $offset, $pagestring) = pagestring($count, 20); $users = DB::LimitQuery('user', array('condition' => $condition, 'order' => 'ORDER BY id DESC', 'size' => $pagesize, 'offset' => $offset)); include template('manage_customer_index');
require_once(dirname(dirname(__FILE__)) . '/app.php'); need_login(); $action = strval($_GET['action']); $action = empty($action) ? "default" : $action; $id = abs(intval($_GET['id'])); $lottery_id = abs(intval($_GET['lottery_id'])); $team = Table::Fetch('team', $id); $lottery = Table::Fetch('lottery', $lottery_id); if ( !$team || $team['begin_time']>time() ) { Session::Set('error', '团购项目不存在'); redirect( WEB_ROOT . '/index.php' ); } //邀请到的用户注册数 $invite_number = Table::Count('invite', array('user_id' => $_SESSION['user_id'])); if($invite_number <= $team['invite_register']){ Session::Set('error', '邀请数未达到要求!'); redirect( WEB_ROOT . '/index.php' ); } $oc = array("user_id"=>$_SESSION['user_id'],'team_id'=>$id); $lottery_new = DB::LimitQuery('lottery', array( 'condition' => $oc, 'order' => 'ORDER BY `add_time` DESC', )); $lottery_id = $lottery_new['0']['id'];
<?php require_once(dirname(dirname(__FILE__)) . '/app.php'); need_partner_m(); $partner_id = abs(intval($_SESSION['partner_id'])); $login_partner = Table::Fetch('partner', $partner_id); if(!$login_partner['fid']){ $condition = array( 'partner_id' => $partner_id, ); $count = Table::Count('store', $condition); list($pagesize, $offset, $pagestring) = pagestring($count, 10); $stores = DB::LimitQuery('store', array( 'condition' => $condition, 'order' => 'ORDER BY id DESC', 'size' => $pagesize, 'offset' => $offset, )); }else { $store = Table::Fetch('store', $login_partner['store_id']); } $city_ids = Utility::GetColumn($teams, 'city_id'); $cities = Table::Fetch('category', $city_ids);
<?php require_once dirname(dirname(__FILE__)) . '/app.php'; need_login(); need_open(option_yes('navforum')); $publics = option_category('public'); $id = abs(intval($_GET['id'])); $condition = array('parent_id' => 0); if ($id && ($public = Table::Fetch('category', $id))) { $condition['public_id'] = $id; } else { if ($id) { redirect(WEB_ROOT . '/forum/public.php'); } else { $condition[] = 'public_id > 0'; } } $count = Table::Count('topic', $condition); list($pagesize, $offset, $pagestring) = pagestring($count, 20); $topics = DB::LimitQuery('topic', array('condition' => $condition, 'size' => $pagesize, 'offset' => $offset, 'order' => 'ORDER BY head DESC, last_time DESC')); $user_ids = Utility::GetColumn($topics, 'user_id'); $luser_ids = Utility::GetColumn($topics, 'last_user_id'); $user_ids = array_merge($user_ids, $luser_ids); $users = Table::Fetch('user', $user_ids); $public = Table::Fetch('category', $id); $pagetitle = $public ? "{$public['name']}讨论区" : '公共讨论区'; include template('forum_public');
$condition['group_id'] = $group_id; } $condition[] = "(city_ids like '%@{$city_id}@%' or city_ids like '%@0@%') or (city_ids = '' and city_id in(0,{$city_id}))"; $count = Table::Count('team', $condition); list($pagesize, $offset, $pagestring) = pagestring($count, $size); $teams = DB::LimitQuery('team', array('condition' => $condition, 'order' => 'ORDER BY `sort_order` DESC, `id` DESC', 'size' => $pagesize, 'offset' => $offset)); $disable_multi = true; /***********************加入的代码:开始*********************************/ $cates = DB::LimitQuery('category', array('condition' => array('zone' => 'group', 'fid' => '0', 'display' => 'Y'), 'order' => 'ORDER BY `sort_order` DESC, `id` DESC')); $alls = array(); $anow = time(); foreach ($cates as $key => $value) { $alls[$key]['name'] = $value[name]; $alls[$key]['ename'] = $value[ename]; $alls[$key]['gid'] = $value[id]; $alls[$key]['number'] = Table::Count('team', array('team_type' => 'normal', 'group_id' => $value[id], "(city_ids like '%@{$city_id}@%' or city_ids like '%@0@%') or (city_ids = '' and city_id in(0,{$city_id}))", "begin_time < '{$anow}'", "end_time > '{$anow}'")); $alls[$key]['teams'] = DB::LimitQuery('team', array('condition' => array('team_type' => 'normal', 'group_id' => $value[id], "(city_ids like '%@{$city_id}@%' or city_ids like '%@0@%') or (city_ids = '' and city_id in(0,{$city_id}))", "begin_time < '{$anow}'", "end_time > '{$anow}'"), 'order' => 'ORDER BY `sort_order` DESC, `id` DESC', 'size' => $value[show_number])); $alls[$key]['recom'] = DB::GetQueryResult("SELECT *,t.id AS tid,p.title AS ptitle, t.title AS ttitle, p.image AS pimage FROM `team` AS t LEFT JOIN `partner` as p ON t.partner_id=p.id WHERE t.group_id={$value['id']} AND t.team_type='normal' AND t.begin_time<'" . $anow . "' AND t.end_time>'" . $anow . "' AND t.is_recom='Y' AND p.display='Y'", false); } /***********************加入的代码:结束*********************************/ die(require_once dirname(__FILE__) . '/multi.php'); } else { $team = $teams = index_get_team($city['id'], $group_id); if ($team && $team['id']) { $_GET['id'] = abs(intval($team['id'])); die(require_once dirname(__FILE__) . '/team.php'); } elseif ($teams) { $disable_multi = true; die(require_once dirname(__FILE__) . '/multi.php'); } }
<?php require_once(dirname(dirname(__FILE__)) . '/app.php'); need_login(true); $condition = array( 'user_id' => $login_user['id'],); $count = Table::Count('flow', $condition); list($pagesize, $offset, $pagestring) = pagestring($count, 20, true); $flows = DB::LimitQuery('flow', array( 'condition'=>$condition, 'size' => $pagesize, 'offset' => $offset, 'order' => 'ORDER BY id DESC', )); $detail_ids = Utility::GetColumn($flows, 'detail_id'); $teams = Table::Fetch('team', $detail_ids); $users = Table::Fetch('user', $detail_ids); $coupons = Table::Fetch('coupon', $detail_ids); die(include template('wap_myflow'));
} if ($ceday) { $cetime = strtotime($ceday); $condition[] = "create_time <= '{$cetime}'"; } if ($pbday) { $pbtime = strtotime($pbday); $condition[] = "pay_time >= '{$pbtime}'"; } if ($peday) { $petime = strtotime($peday); $condition[] = "pay_time <= '{$petime}'"; } /* end fiter */ $count = Table::Count('order', $condition); list($pagesize, $offset, $pagestring) = pagestring($count, 20); $orders = DB::LimitQuery('order', array( 'condition' => $condition, 'order' => 'ORDER BY id DESC', 'size' => $pagesize, 'offset' => $offset, )); $pay_ids = Utility::GetColumn($orders, 'pay_id'); $pays = Table::Fetch('pay', $pay_ids); $user_ids = Utility::GetColumn($orders, 'user_id'); $users = Table::Fetch('user', $user_ids);
<?php require_once dirname(dirname(__FILE__)) . '/app.php'; need_login(); $condition = array(); if (!option_yes('usercredit')) { Session::Set('notice', "未开启积分模块!"); redirect(WEB_ROOT . '/order/index.php'); } $count = Table::Count('goods', $condition); list($pagesize, $offset, $pagestring) = pagestring($count, 20); $goods = DB::LimitQuery('goods', array('condition' => $condition, 'size' => $pagesize, 'offset' => $offset, 'order' => 'ORDER BY id DESC')); $pagetitle = '兑换商品'; include template('credit_goods');
if($seo_title) $pagetitle = $seo_title; /*end*/ /********************************************* * 模版来点评 * @author abei <*****@*****.**> * @version 2014-04-02 * @link http://www.maige123.com ********************************************/ // 半年内点评的人数 $remark = Table::Fetch("dptpl",$team['dptpl_id']); $cond['team_id'] = $id; $cond['state'] = 'pay'; $cond[] = 'had_dp > 0'; $cond[] = 'pay_time > '.(time()-86400*180); $had_remark_user_num = Table::Count('order', $cond); // 整体评分综合数 $orders = DB::LimitQuery("order",array('condition'=>$cond)); $order_remark_ids = Utility::GetColumn($orders, 'had_dp'); $order_remarks = Table::Fetch('order_dp', $order_remark_ids); $real_total_remark = 0; $score_level_tip_list = array( 1=>'太差', 2=>'不好', 3=>'一般', 4=>'很好', 5=>'真好', ); $score_level_list[1] = $score_level_list[2] = $score_level_list[3] = $score_level_list[4] = $score_level_list[5] = 0; $level_score = 0;
<?php require_once dirname(dirname(dirname(__FILE__))) . '/app.php'; need_manager(); $condition = array(); ($zone = strval($_GET['zone'])) || ($zone = 'city'); if ($zone) { $condition['zone'] = $zone; } $cates = get_zones(); $count = Table::Count('category', $condition); list($pagesize, $offset, $pagestring) = pagestring($count, 20); $categories = DB::LimitQuery('category', array('condition' => $condition, 'order' => 'ORDER BY display ASC, sort_order DESC, id DESC', 'size' => $pagesize, 'offset' => $offset)); include template('manage_category_index');