public function get_list($status = 0, $user_id = MEMBER_ID) { $timestamp = time(); if ($status == 0 ) { $sql_limit_status = 'p.overtime > '.$timestamp.' AND p.begintime < '.$timestamp; } if($status == 1){ $sql_limit_status = 'p.overtime < '.$timestamp; } if($status == 2){ $sql_limit_status = 'p.begintime > '.$timestamp; } if ($status == -1) { $sql_limit_status = '1'; } $sql = 'SELECT p.*, f.uid, f.pid FROM ' . table('favorite') .' f , ' . table('product') . ' p WHERE '."f.uid = ".$user_id.' AND f.pid = p.id AND '. $sql_limit_status; $sql = page_moyo($sql); $results = dbc(DBCMax)->query($sql)->done(); return $results; }
public function GetList($pid, $uid = false, $limit = false, $order = 'number.ASC', $pager = false) { $q = dbc(DBCMax)->select('prize_ticket')->where('pid='.$pid); $uid && $q->where('uid='.$uid); $limit && $q->limit($limit); $order && $q->order($order); return $pager ? dbc(DBCMax)->query(page_moyo($q->sql()))->done() : $q->done(); }
public function get_list_for_me($uid){ $sql = "SELECT * FROM ". table('credit') ." WHERE uid='". (int)$uid ."' ORDER BY id DESC"; $sql = page_moyo($sql); $res = dbc(DBCMax)->query($sql)->done(); if( $res ){ return $res; }else{ return array(); } }
public function get_list($limit = 0) { if ($limit) { $sql = dbc(DBCMax)->select('article')->order('timestamp_create.desc')->limit($limit); }else{ $sql = dbc(DBCMax)->select('article')->order('timestamp_create.desc'); } $sql = dbc(DBCMax)->sql($sql); if (!$limit) $sql = page_moyo($sql); $results = dbc(DBCMax)->query($sql)->done(); return $results; }
public function GetList($process = 0, $uid = 0, $orderid = 0) { if ($process > 0) { $sql_where .= ' process = '.$process; }else{ $sql_where = '1'; } $sql = 'SELECT * FROM '.table('refund').' WHERE ' .$sql_where. ' ORDER by `dateline` desc'; $sql = page_moyo($sql); $result = dbc(DBCMax)->query($sql)->done(); return $result; }
function GetList($type = null, $city = null) { $sql_limit_type = '1'; if (!is_null($type)) { $sql_limit_type = 'type="'.$type.'"'; } $sql_limit_city = '1'; if (!is_null($city)) { $sql_limit_city = 'city='.$city; } $sql = 'SELECT * FROM '.table('subscribe').' WHERE '.$sql_limit_type.' AND '.$sql_limit_city.' AND validated="true"'; $sql = page_moyo($sql); return ($query = dbc()->Query($sql)) ? $query->GetAll() : array(); }
public function GetList($alsend = '', $extend = '1') { $sql_order = 'o.paytime DESC'; if ($alsend == 'WAIT_SELLER_SEND_GOODS') { $sql_order = 'o.paytime ASC'; } $sql = 'SELECT o.*, p.flag FROM '.table('order').' o LEFT JOIN '.table('product').' p ON o.productid = p.id WHERE p.type="stuff" AND o.status='.ORD_STA_Normal.' AND '.$extend.' ORDER BY '.$sql_order; logic('isearcher')->Linker($sql); $sql = page_moyo($sql); $result = dbc(DBCMax)->query($sql)->done(); if($result){ foreach ($result as $i => $order) { $product = array('flag'=>$result[$i]['flag']); unset($result[$i]['flag']); $result[$i]['product'] = $product; $result[$i]['express'] = logic('express')->SrcOne($order['expresstype']); $result[$i]['address'] = logic('address')->GetOne($order['addressid']); $result[$i]['attrs'] = logic('attrs')->snapshot($order['orderid'], $order['productid']); } } return $result; }
public function GetList( $uid = 0, $status = ORD_STA_ANY, $pay = ORD_PAID_ANY, $extend = '1',$notpage = 1 ) { $sql_limit_user = '******'; if ($uid > 0) { $sql_limit_user = '******'.$uid; } $sql_limit_status = '1'; if ( $status >= 0 ) { $sql_limit_status = 'status = '.$status; } $sql_limit_pay = '1'; if ( $pay >= 0 ) { $sql_limit_pay = 'pay = '.$pay .' AND `process`<>"_TimeLimit_" '; } $sql = 'SELECT o.*, m.username FROM ' . table('order') .' o LEFT JOIN ' .table('members'). ' m ON (o.userid=m.uid) WHERE '.$sql_limit_user.' AND '.$sql_limit_status.' AND '.$sql_limit_pay.' AND '.$extend.' ORDER BY buytime DESC'; if($notpage){ logic('isearcher')->Linker($sql); $sql = page_moyo($sql); } $order = dbc(DBCMax)->query($sql)->done(); return $this->__parse_result($order); }
public function admin_vlist() { $sql = dbc(DBCMax)->select('comments')->order('timestamp_update.desc')->sql(); $sql = page_moyo($sql); $comments = dbc(DBCMax)->query($sql)->done(); $comments || $comments = array(); $products = array(); foreach ($comments as $i => $comment) { if (isset($products[$comment['product_id']])) { $product = $products[$comment['product_id']]; } else { $product = $products[$comment['product_id']] = logic('product')->SrcOne($comment['product_id']); } $comments[$i]['product'] = $product; } return $comments; }
public function get_link_list($sellerid = 0){ $data = array(); if($sellerid > 0){ $sql = 'SELECT * FROM `'.table('product_link').'` WHERE `sellerid`='.$sellerid; }else{ $sql = 'SELECT * FROM `'.table('product_link').'`'; } $sql = page_moyo($sql); $data = dbc(DBCMax)->query($sql)->done(); if($data){ foreach($data as $key => $val){ $data[$key] = $this->_format_link_data($val); } } return $data; }
public function count_fund($where = '1') { $sql = "SELECT o.productid as id,p.flag as productname,p.nowprice as productprice,p.fundprice,p.type,s.sellername,s.profit_pre,m.username,COUNT(*) as ordercount,SUM(o.productnum) as productcount,SUM(o.totalprice) as moneycount,SUM(o.expressprice) as expressprices,SUM(o.totalprice-o.expressprice-o.productnum*o.productprice) as arrtsmoney FROM ".table('order')." o LEFT JOIN ".table('product')." p ON o.productid = p.id LEFT JOIN ".table('seller')." s ON p.sellerid = s.id LEFT JOIN ".table('members')." m ON s.userid = m.uid WHERE o.totalprice > 0 AND o.pay = 1 AND ".$where." GROUP BY o.productid ORDER BY o.productid ASC"; logic('isearcher')->Linker($sql); $sql = page_moyo($sql); $fund_data = dbc(DBCMax)->query($sql)->done(); if($fund_data){ foreach($fund_data as $key => $val){ if(empty($val['productname'])){ unset($fund_data[$key]); continue; } $fund_data[$key]['fundprice'] = $val['fundprice'] < 0 ? '--' : $val['fundprice']; $fund_data[$key]['profit_pre'] = $val['profit_pre'] > 0 ? round($val['profit_pre']).'%' : '--'; $orderids = $this->get_query_order($val['id']); if($val['type'] == 'stuff'){ $sq = "SELECT SUM(productnum) as wnum FROM ".table('order')." WHERE orderid IN(".implode(',',$orderids).") AND process = 'WAIT_SELLER_SEND_GOODS'"; $dat = dbc(DBCMax)->query($sq)->limit(1)->done(); $fund_data[$key]['waitsendgoods'] = $dat['wnum'] ? $dat['wnum'] : '0'; $sq = "SELECT SUM(productnum) as wnum FROM ".table('order')." WHERE orderid IN(".implode(',',$orderids).") AND process = 'TRADE_FINISHED'"; $dat = dbc(DBCMax)->query($sq)->limit(1)->done(); $fund_data[$key]['ticketused'] = $dat['wnum'] ? $dat['wnum'] : '0'; $sq = "SELECT SUM(productnum) as wnum FROM ".table('order')." WHERE orderid IN(".implode(',',$orderids).") AND process = 'WAIT_BUYER_CONFIRM_GOODS'"; $dat = dbc(DBCMax)->query($sq)->limit(1)->done(); $fund_data[$key]['ticketunused'] = $dat['wnum'] ? $dat['wnum'] : '0'; $fund_data[$key]['ticketfailed'] = '--'; $fund_data[$key]['ticketoverdue'] = '--'; }elseif($val['type'] == 'ticket'){ $fund_data[$key]['waitsendgoods'] = '--'; $sq = "SELECT count(*) as wnum FROM ".table('ticket')." WHERE orderid IN(".implode(',',$orderids).") AND status = '".TICK_STA_Used."'"; $dat = dbc(DBCMax)->query($sq)->limit(1)->done(); $fund_data[$key]['ticketused'] = $dat['wnum'] ? $dat['wnum'] : '0'; $sq = "SELECT count(*) as wnum FROM ".table('ticket')." WHERE orderid IN(".implode(',',$orderids).") AND status = '".TICK_STA_Unused."'"; $dat = dbc(DBCMax)->query($sq)->limit(1)->done(); $fund_data[$key]['ticketunused'] = $dat['wnum'] ? $dat['wnum'] : '0'; $sq = "SELECT count(*) as wnum FROM ".table('ticket')." WHERE orderid IN(".implode(',',$orderids).") AND status = '".TICK_STA_Invalid."'"; $dat = dbc(DBCMax)->query($sq)->limit(1)->done(); $fund_data[$key]['ticketfailed'] = $dat['wnum'] ? $dat['wnum'] : '0'; $sq = "SELECT count(*) as wnum FROM ".table('ticket')." WHERE orderid IN(".implode(',',$orderids).") AND status = '".TICK_STA_Overdue."'"; $dat = dbc(DBCMax)->query($sq)->limit(1)->done(); $fund_data[$key]['ticketoverdue'] = $dat['wnum'] ? $dat['wnum'] : '0'; }else{ $fund_data[$key]['waitsendgoods'] = '--'; $fund_data[$key]['ticketused'] = '--'; $fund_data[$key]['ticketunused'] = '--'; $fund_data[$key]['ticketfailed'] = '--'; $fund_data[$key]['ticketoverdue'] = '--'; } $sqa = "SELECT deal_money,fund_money,salary_money FROM ".table('rebate_log')." WHERE orderid IN(".implode(',',$orderids).") AND `type` = 'master'"; $dat = dbc(DBCMax)->query($sqa)->done(); $refundmoneys = $rebatmoneys = 0; if($dat){ foreach($dat as $val){ if($val['fund_money'] > 0){ $refundmoneys += $val['fund_money']; $rebatmoneys = $rebatmoneys + ($val['deal_money']-$val['fund_money']); }else{ $refundmoneys = $refundmoneys + ($val['deal_money']-$val['fund_money']); $rebatmoneys += $val['fund_money']; } } } $fund_data[$key]['refundmoneys'] = $refundmoneys; $fund_data[$key]['rebatmoneys'] = $rebatmoneys; } } return $fund_data; }
public function GetList($type = null) { $sql_limit_type = '1'; if (!is_null($type)) { $sql_limit_type = 'type="'.$type.'"'; } $sql = 'SELECT * FROM '.table('push_template').' WHERE '.$sql_limit_type.' ORDER BY `update` DESC'; $sql = page_moyo($sql); return dbc(DBCMax)->query($sql)->done(); }
public function log( $uid = 0, $class = 'usr' ) { if ($class == '*') { $sql_limit_class = '1'; } else { $sql_limit_class = 'class = "'.$class.'"'; } $uid = ($uid > 0) ? $uid : user()->get('id'); $sql = 'SELECT * FROM ' . table('usermoney') . ' WHERE userid = ' . $uid . ' AND ' .$sql_limit_class. ' ORDER BY id DESC'; $sql = page_moyo($sql); return dbc(DBCMax)->query($sql)->done(); }
public function GetList( $uid = 0, $oid = 0, $status = TICK_STA_Unused, $pid = false, $spid = '') { $sql_limit_user = '******'; if ($uid > 0) { $sql_limit_user = '******'.$uid; } $sql_limit_order = '1'; if ($oid > 0) { $sql_limit_order = 't.orderid = '.$oid; } $sql_limit_status = 't.status = '.$status; if ($status < 0) { $sql_limit_status = '1'; } elseif ($status == TICK_STA_Overdue) { $sql_limit_status = "t.status IN (".TICK_STA_Unused.",".TICK_STA_Overdue.") AND p.perioddate < '".time()."'"; } elseif ($status == TICK_STA_Unused) { $sql_limit_status = "t.status = '".TICK_STA_Unused."' AND p.perioddate > '".time()."'"; } if ($status == TICK_STA_Used) { $orderby = 't.usetime'; }else{ $orderby = 't.ticketid'; } $sql_limit_product = $pid ? ('t.productid='.$pid) : '1'; $sql_limit_sproduct = '1'; if(strlen($spid) > 0){ $sql_limit_sproduct = "t.productid in(".$spid.")"; } $sql = 'SELECT t.*, p.name, p.flag, p.intro, p.perioddate, o.productnum, o.productprice FROM ' . table('ticket').' t LEFT JOIN ' . table('order').' o ON (t.orderid = o.orderid) LEFT JOIN ' . table('product').' p ON (t.productid = p.id) WHERE '.$sql_limit_user.' AND '.$sql_limit_order.' AND ' . $sql_limit_status . ' AND '.$sql_limit_product.' AND '.$sql_limit_sproduct.' ORDER BY '.$orderby.' DESC'; logic('isearcher')->Linker($sql); $sql = page_moyo($sql); $coupom = dbc(DBCMax)->query($sql)->done(); if($coupom){ foreach($coupom as $key => $val){ if($val['status'] == TICK_STA_Unused && $val['perioddate'] < time()){ $coupom[$key]['status'] = (string)TICK_STA_Overdue; } } } return $coupom; }
public function AskList($limit = null) { $sql_limit = ''; if (!is_null($limit)) { $sql_limit = 'LIMIT '.$limit; } $ckey = 'misc.asklist'.$sql_limit; $list = cached($ckey); if ($list) return $list; $sql = 'SELECT * FROM '.table('question').' WHERE reply <> "" ORDER BY time DESC '.$sql_limit; $sql_limit != '' || $sql = page_moyo($sql); return dbc(DBCMax)->query($sql)->done(); }
public function Search($filter, $extSQL = '1') { return dbc(DBCMax)->query(page_moyo(dbc(DBCMax)->select('zlog')->where($filter)->where($extSQL)->order('time.DESC')->sql()))->done(); }
<? } ?> </tbody> </table> <? } else { ?><?=ui('loader')->js('#admin/js/cash.order.ops')?> <div class="header"> <a href="?mod=cash&code=order">用户提现记录列表</a> </div> <?=ui('isearcher')->load('admin.cash_order_list')?> <table id="orderTable" cellspacing="1" cellpadding="4" width="100%" align="center" class="tableborder"> <thead> <tr class="tr_nav"> <td width="15%">提现记录流水号</td> <td width="10%">提现用户</td> <td width="6%">提现金额</td> <td width="16%">提现方式/受理时间</td> <td width="8%">提现处理</td> </tr> </thead> <tbody> <? if(is_array($list)) { foreach($list as $one) { ?> <tr id="ro_on_<?=$one['id']?>"> <td> <?=$one['orderid']?> </td> <td><? echo app('ucard')->load($one['userid']); ?></td> <td> <?=$one['money']?> </td> <td> <? if($one['paytype'] =='money') { ?> 上门提现<br/><? } elseif($one['paytype'] =='bank') { ?>银行转帐[<?=$one['bankname']?>]<br/> [<?=$one['bankusername']?>]<?=$one['bankcard']?><br/><? } elseif($one['paytype'] =='alipay') { ?>支付宝<br/>[<?=$one['bankusername']?>]<?=$one['alipay']?><br/> <? } ?> <? if($one['paytime'] > 0) { ?> 受理时间:<? echo date('Y-m-d H:i:s', $one['paytime']); ?> <? } else { ?>等待处理 <? } ?> </td> <td> <? if($one['status']=='no') { ?> <a href="javascript:cashOrderConfirm('<?=$one['orderid']?>');">[允许提现]</a><? } elseif($one['status'] =='doing') { ?>正在处理<br><a href="?mod=cash&code=order&orderid=<?=$one['orderid']?>"><font style="border:1px solid #999;padding:4px;background-color:#f2f2f2;">开始受理</font></a><? } elseif($one['status'] =='yes') { ?><font color="green">提现成功</font><br><a href="?mod=cash&code=order&orderid=<?=$one['orderid']?>">查看详情</a> <? } else { ?><font color="red">提现失败</font><br><a href="?mod=cash&code=order&orderid=<?=$one['orderid']?>">查看详情</a> <? } ?> </td> </tr> <? } } ?> </tbody> <tfoot> <tr> <td colspan="5"><?=page_moyo()?></td> </tr> </tfoot> </table> <? } ?> <? include handler('template')->file('@admin/footer'); ?>
public function GetList($used = -1) { $used < 0 && $sql_used = '1'; $used > 0 && $sql_used = 'usetime > 0'; $used == 0 && $sql_used = 'usetime = 0'; $sql = 'SELECT * FROM '.table('recharge_card').' WHERE '.$sql_used.' ORDER BY id DESC'; logic('isearcher')->Linker($sql); $sql = page_moyo($sql); $query = dbc()->Query($sql); return $query ? $query->GetAll() : array(); }
public function get_my_rebate_list(){ $sql = "SELECT r.*,t.number,t.mutis,p.flag FROM ". table('rebate_log') ." r LEFT JOIN ". table('ticket') ." t ON r.ticketid = t.ticketid LEFT JOIN ". table('order') ." o ON r.orderid = o.orderid LEFT JOIN ". table('product') ." p ON o.productid = p.id WHERE r.uid='". MEMBER_ID ."' AND r.type='master' ORDER BY r.id DESC"; $sql = page_moyo($sql); $res = dbc(DBCMax)->query($sql)->done(); if( $res ){ return $res; }else{ return array(); } }
public function Getlog($orderid) { $sql = dbc(DBCMax)->select('fund_order_log')->where('orderid = '.$orderid)->order('id.asc')->sql(); $sql = page_moyo($sql); return dbc(DBCMax)->query($sql)->done(); }
function GetList( $cid = -1, $category = '1' ) { $sql_limit_city = '1'; if ( $cid > 0 ) { $sql_limit_city = ' ( s.area = ' . $cid . ' ) '; } $sql = 'SELECT s.*' . $this->get_list_ext_sql() . ' FROM ' . table('seller') . ' s WHERE ' . $sql_limit_city . ' AND ' . $category . ' AND ' . logic('city')->seller_sql_filter() . ' AND ' . logic('isearcher')->seller_sql_filter() . ' AND ' . $this->price_sql_filter() . ' AND `enabled` = "true" ORDER BY ' . logic('sort')->seller_sql_filter(); logic('isearcher')->Linker($sql); $sql = page_moyo($sql); return dbc(DBCMax)->query($sql)->done(); }