public function index() { $post = I('post.'); $search['keyword'] = trim($post['keyword']); //标题 $search['language'] = trim($post['language']); //语言 $search['status'] = trim($post['status']); //状态 if ($search['keyword'] != '') { $where['1dcq_news.title'] = array('like', '%' . $search['keyword'] . '%'); } if ($search['language'] > 0) { $where['1dcq_news.language'] = array('eq', $search['language']); } if ($search['status'] > 0) { $where['1dcq_news.audit_status'] = array('eq', $search['status'] - 1); } $news = M('news')->field('1dcq_news.*,1dcq_attachment.file_url')->join('left join 1dcq_attachment ON 1dcq_news.news_pic = 1dcq_attachment.attachement_id')->order('1dcq_news.order desc,1dcq_news.create_time desc'); // $where = array(); $result = select_table($news, $where, intval(I('pageNumber')), 4); foreach ($result['data'] as &$v) { $v['content'] = ltrim(str_replace(' ', '', $v['content'])); $v['content'] = strip_tags($v['content']); } $this->assign('search', $search); $this->assign('list', $result); $this->display(); }
public function pay_four() { $Payment = M('pay_channel')->alias('a')->join('left join ' . C("DB_PREFIX") . 'pay_type as b on b.id = a.channel_type'); $list = select_table($Payment, $where, I('pageNumber')); $this->assign('list', $list); $this->display(); }
/** * 显示当前o2o管理后台角色信息 */ public function index() { $list = select_table('role2', '', I('pageNumber'), 5); //分页数据 $this->assign('list', $list); //保存所有角色信息 $this->display('showRole'); }
/** * 查询合作银行信息 */ public function index() { $bankname = $_REQUEST['brankname']; if (!empty($bankname)) { $where['bank_name'] = array('eq', $bankname); } $banktable = M('bank')->join('LEFT JOIN 1dcq_attachment on 1dcq_bank.bank_logo=1dcq_attachment.attachement_id'); $bank = select_table($banktable, $where, $_REQUEST['pageNumber'], 5); $this->assign('bank', $bank); $this->display('showbank'); }
/** * 查询计量单位管理信息 */ public function index() { $where = array(); $unit_name = $_REQUEST['unit_name']; if ($unit_name) { $where['unit_name'] = array('like', "%{$unit_name}%"); } $table = M('goods_unit')->order('1dcq_goods_unit.unit_id desc'); $measure = select_table($table, $where, $_REQUEST['pageNumber']); $this->assign('measure', $measure); $this->display('showMeaSure'); }
public function publish() { $news = M('news')->field('1dcq_news.*,1dcq_attachment.file_url')->join('left join 1dcq_attachment ON 1dcq_news.news_pic = 1dcq_attachment.attachement_id')->order('1dcq_news.order desc,1dcq_news.create_time desc'); $where = array('1dcq_news.audit_status' => '1'); $result = select_table($news, $where, intval(I('pageNumber')), 4); foreach ($result['data'] as &$v) { $v['content'] = ltrim(str_replace(' ', '', $v['content'])); $v['content'] = strip_tags($v['content']); } $this->assign('list', $result); $this->display(); }
public function index() { /** * shop_grade 店铺评级表 */ $shop_grade = M('rate'); //实例化店铺评级表 $list = select_table('rate', '', I('pageNumber'), 5); $sum = $shop_grade->count(); $this->assign('sum', $sum); $this->assign('list', $list); $this->display(); }
/** *显示当前o2o管理后台中所有的账户信息 */ public function index() { $this->getMenusRole(6); $table = M('admin')->join('LEFT JOIN 1dcq_role2 on 1dcq_admin.r_id=1dcq_role2.role_id '); $list = select_table($table, array('userstate' => array('eq', '1')), $_REQUEST['pageNumber'], 5); $roleResult = $this->showRole(); //查询所有角色信息 $this->assign('list', $list); //保存账号分页信息 $this->assign('role', $roleResult); //保存角色信息 $this->display('showAccount'); }
public function index() { $classify_id = I('classify_id'); $classify_name = I('classify_name'); $table = M('operation_classify')->alias('oc')->field("oc.*,at.file_url")->join("left join " . C('DB_PREFIX') . "attachment as at on at.attachement_id=oc.classify_logo_id ")->order('classify_id asc'); $where = array(); if (!empty($classify_id)) { $where['oc.parent_classify_id'] = array('eq', $classify_id); } else { $where['oc.parent_classify_id'] = array('eq', 0); } if (!empty($classify_name)) { $where['oc.classify_name'] = array('like', "%{$classify_name}%"); $where['oc.parent_classify_id'] = array('EGT', 0); } //右边 $list = select_table($table, $where, $_REQUEST['pageNumber']); $kk = ($list['current'] - 1) * $list['pagecount']; $this->assign('list', $list); $this->assign('kk', $kk); //获取左边 $column_list_one = $table->where(array('parent_classify_id' => array('eq', 0)))->order("classify_id asc")->select(); $column_list_two = $table->where(array('parent_classify_id' => array('neq', 0)))->order("classify_id asc")->select(); $column_list = array(); foreach ($column_list_two as $key => $val) { //$column_list[$val['parent_classify_id']][$key]['classify_name'] = $val['classify_name']; // $column_list[$val['parent_classify_id']][$key]['classify_id'] = $val['classify_id']; $column_list[$val['parent_classify_id']][] = array('classify_name' => $val['classify_name'], 'classify_id' => $val['classify_id']); } $left_list = array(); foreach ($column_list_one as $k => $v) { $left_list[$k]['classify_name'] = $v['classify_name']; $left_list[$k]['classify_id'] = $v['classify_id']; $left_list[$k]['column_two_list'] = $column_list[$v['classify_id']]; } //右边 $oneName = $table->where(array('classify_id' => array('eq', $classify_id)))->getField('classify_name'); $this->assign('oneName', $oneName); $this->assign('left_list', $left_list); $this->assign('classify_id', $classify_id); $this->assign('column_list_one', $column_list_one); /* $_SESSION['dbdata'] = null; $industryItems = $this->getIndustryItems(); $this->assign('industryItems',$industryItems); $temps = $this->seachIndutryItems($industryItems,0); $this->assign('editItems',$temps); //print_r($temps);*/ $this->display(); }
public function index() { $column_id = I('column_id'); $column_name = I('column_name'); $table = M('column')->order('column_index asc'); $where = array(); if (!empty($column_id)) { $where['parent_column_id'] = array('eq', $column_id); } else { $where['parent_column_id'] = array('eq', 0); } if (!empty($column_name)) { $where['column_name'] = array('like', "%{$column_name}%"); $where['parent_column_id'] = array('EGT', 0); } //右边 $list = select_table($table, $where, I('pageNumber')); $this->assign('list', $list); //获取左边 $column_list_one = $table->where(array('parent_column_id' => array('eq', 0)))->select(); $column_list_two = $table->where(array('parent_column_id' => array('neq', 0)))->select(); $column_list = array(); foreach ($column_list_two as $key => $val) { //$column_list[$val['parent_column_id']][$key]['column_name'] = $val['column_name']; // $column_list[$val['parent_column_id']][$key]['column_id'] = $val['column_id']; $column_list[$val['parent_column_id']][] = array('column_name' => $val['column_name'], 'column_id' => $val['column_id']); } $left_list = array(); foreach ($column_list_one as $k => $v) { $left_list[$k]['column_name'] = $v['column_name']; $left_list[$k]['column_id'] = $v['column_id']; $left_list[$k]['column_two_list'] = $column_list[$v['column_id']]; } $this->assign('left_list', $left_list); $this->assign('column_id', $column_id); $this->assign('column_list_one', $column_list_one); /* $_SESSION['dbdata'] = null; $industryItems = $this->getIndustryItems(); $this->assign('industryItems',$industryItems); $temps = $this->seachIndutryItems($industryItems,0); $this->assign('editItems',$temps); //print_r($temps);*/ $this->display(); }
public function index() { /** * user_shop_comment 店铺评论表 * */ $user_shop_comment = M('user_shop_comment'); //实例化店铺评论表 $where = array(); $comment_time = ''; $name = ''; if ($_POST) { /*判断时间*/ if (I('comment_time')) { $time = I('comment_time'); $time_all = explode('-', $time); $start = strtotime(trim($time_all[0])); $end = strtotime(trim($time_all[1])); /*如果是选择同一天*/ if ($start == $end) { $end = $end + 24 * 60 * 60; } $where['UNIX_TIMESTAMP(comment_time)'] = array('between', array($start, $end)); $comment_time = I('comment_time'); } /*判断单号*/ if (I('name')) { $name = trim(I('name')); $where['_string'] = '(1dcq_order.order_id like "%' . $name . '%") OR ( 1dcq_shop.shop_name like "%' . $name . '%") '; $name = I('name'); } } $where['comment_status'] = array('in', '1,2'); $arraylist = $user_shop_comment->join('LEFT JOIN 1dcq_order on 1dcq_order.order_id=1dcq_user_shop_comment.order_id')->join('LEFT JOIN 1dcq_user on 1dcq_user.user_id=1dcq_user_shop_comment.user_id')->join('LEFT JOIN 1dcq_shop on 1dcq_shop.shop_id=1dcq_user_shop_comment.shop_id')->field('1dcq_user.mobile,1dcq_shop.shop_name,1dcq_order.order_id,1dcq_user_shop_comment.comment_id,1dcq_user_shop_comment.comment_status,1dcq_user_shop_comment.env_grade,1dcq_user_shop_comment.service_grade,1dcq_user_shop_comment.comment_content,1dcq_user_shop_comment.comment_time'); $payments = select_table($arraylist, $where, I('pageNumber'), 5); $this->assign('payments', $payments); //保存分页信息 $this->assign('name', $name); $this->assign('comment_time', $comment_time); $this->display(); }
public function index_send() { $user_type = I('user_type'); $tip = I('tip'); if (!empty($user_type)) { $where['target_user_type'] = array('eq', $user_type); } if (!empty($tip)) { $where['msg_desc'] = array('like', "%{$tip}%"); } $where['msg_type'] = array('eq', 1); //$where['pub_user_id'] = array('eq',$this->aid); $table = M('message')->alias('a')->join('left join ' . C("DB_PREFIX") . 'province as b on b.province_id = a.province_id')->join('left join ' . C("DB_PREFIX") . 'city as c on c.city_id = a.city_id')->join('left join ' . C("DB_PREFIX") . 'district as d on d.district_id = a.district_id')->join('left join ' . C("DB_PREFIX") . 'town as e on e.town_id = a.town_id')->order('pub_time desc'); //->field('province_name,city_name,district_name,town_name') $list = select_table($table, $where, I('pageNumber')); //print_r($list); $notice = $this->notice(); $this->assign('list', $list); $this->assign('notice', $notice); $this->display(); }
public function index() { $userstatus = $_REQUEST['userstatus']; //会员状态 $time = $_REQUEST['time']; //时间段 $account = $_REQUEST['account']; //账号 if ($userstatus == 50) { $where['1dcq_user_feedback.phone'] = array('neq', " "); } if ($userstatus != 50 && $userstatus != "") { $where['1dcq_user.user_type'] = array('eq', $userstatus); } if (!empty($account)) { $where['1dcq_user.username'] = array('eq', $account); } if (!empty($time)) { $timelist = explode("-", $time); $time1 = date('Y-m-d H:i:s', strtotime($timelist[0])); $time2 = date('Y-m-d 23:59:59', strtotime($timelist[1])); $where['1dcq_user_feedback.create_time'] = array('between', array($time1, $time2)); } $table = M('user_feedback')->join("LEFT JOIN 1dcq_user on 1dcq_user_feedback.user_id=1dcq_user.user_id")->field('1dcq_user_feedback.*,1dcq_user.username,1dcq_user.true_name,1dcq_user.user_type,1dcq_user.mobile')->order('1dcq_user_feedback.feedback_id desc'); $list = select_table($table, $where, $_REQUEST['pageNumber']); //分页数据 $where['handle_status'] = array('eq', 0); //未处理状态 //查询未处理条数 $countfee = M('user_feedback')->join("LEFT JOIN 1dcq_user on 1dcq_user_feedback.user_id=1dcq_user.user_id")->where($where)->count(); $this->assign('feecount', $countfee); foreach ($list['data'] as &$value) { $value['feedback'] = str_replace(array("\r\n", "\r", "\n", " "), "", $value['feedback']); } $this->assign('fee', $list); $this->display('showFeedback'); }
public function user_list() { $order_id = $_REQUEST['order_id']; $time = $_REQUEST['time']; $type_time = $_REQUEST['type_time']; $user_id = $_REQUEST['user_id']; $refer_user_id = $_REQUEST['refer_user_id']; if (!empty($order_id)) { $where_bill['order_id'] = array('eq', $order_id); } if (!empty($time)) { $time = explode('-', $time); $where_bill['create_time'] = array('BETWEEN', date('Y-m-d H:i:s', strtotime($time[0])), date('Y-m-d H:i:s', strtotime($time[1]))); } if (!empty($type_time)) { switch ($type_time) { case '1': //本月 $where_bill['settle_time'] = array('BETWEEN', array(date('Y-m', time()) . '-01 00:00:00', date('Y-m', time()) . '-31 23:59:59')); break; case '2': //近3个月 $ti = find_createtime(4); $where_bill['settle_time'] = array('BETWEEN', array(date('Y-m-d H:i:s', $ti['createtime'][0]), date('Y-m-d H:i:s', $ti['createtime'][1]))); break; case '3': //近一年 $ti = find_createtime(5); $where_bill['settle_time'] = array('BETWEEN', array(date('Y-m-d H:i:s', $ti['createtime'][0]), date('Y-m-d H:i:s', $ti['createtime'][1]))); break; } } $where_bill['user_id'] = array('eq', $user_id); $where_bill['user_ref_share_user_id'] = array('eq', $refer_user_id); $table = M('order')->alias('a')->field('a.shop_serve_share_price,a.order_id,a.settle_time as create_time,(select mobile from ' . C("DB_PREFIX") . 'user where user_id = a.user_id),a.order_total_price,a.user_ref_share_price,(select shop_name from ' . C("DB_PREFIX") . 'shop where shop_id = a.shop_id) as shop_name ,(select (select city_name from ' . C("DB_PREFIX") . 'city where city_id = sp.city_id) from ' . C("DB_PREFIX") . 'shop as sp where sp.shop_id = a.shop_id) as city_name ,(select (select column_name from ' . C("DB_PREFIX") . 'column where column_id = sp.column_id) from ' . C("DB_PREFIX") . 'shop as sp where sp.shop_id = a.shop_id) as column_name ')->order('a.settle_time desc'); $list_bill = select_table($table, $where_bill, $_REQUEST['pageNumber']); $total = M('order')->where($where_bill)->sum('user_ref_share_price'); //推荐总收益 if (!$total) { $total = 0; } $this->assign('mobile', M('user')->where(array('user_id' => array('eq', $refer_user_id)))->getField('mobile')); $this->assign('total', $total); $this->assign('list', $list_bill); $id = $_GET['shop_id']; $shopModel = M('Shop'); $where = array(); if ($id) { $where['shop_id'] = $id; } $data = $shopModel->where($where)->find(); $this->assign('shop', $data); $this->assign('search_order_id', $order_id); $this->display(); }
/** * 客服分类信息 */ public function showKfCate() { /***************************************************************************************/ //APP端分类信息 $table = M('help_info_category')->order('category_index'); $tablelist = select_table($table, '', $_REQUEST['pageNumber'], 10); //分页数据 $this->assign('cateinfo', $tablelist); /*=====================================================================================*/ $this->display('showKfCategory'); }
<link rel="stylesheet" href="../css/vertical_scroll_new/style.css"> <link rel="stylesheet" href="../css/vertical_scroll_new/jquery.mCustomScrollbar.css"> <!-- Bootstrap --> <script src="../js/bootstrap.min.js" type="text/javascript"></script> <!-- jQuery 2.0.2 --> <script src="../js/jquery.js"></script> <script type="text/javascript"> function save_all_position(){ var scrollLeft = (window.pageXOffset !== undefined) ? window.pageXOffset : (document.documentElement || document.body.parentNode || document.body).scrollLeft; var scrollTop = (window.pageYOffset !== undefined) ? window.pageYOffset : (document.documentElement || document.body.parentNode || document.body).scrollTop; <?php $q_save = select_table($building_id); while ($r_save = mysql_fetch_array($q_save)) { ?> var element = document.getElementById('makeMeDraggable_<?php echo $r_save['table_id']; ?> '); var position = element.getBoundingClientRect(); var x = position.left; var y = position.top; $.ajax({ type: "GET", url: "table.php?page=save_table_location", data:{id:<?php
private function getUserAddress($user_id) { if (empty($user_id)) { return false; } $user_address = M('user_address')->alias('a')->join('left join ' . C("DB_PREFIX") . 'province as b on b.province_id = a.province_id')->join('left join ' . C("DB_PREFIX") . 'city as c on c.city_id = a.city_id')->join('left join ' . C("DB_PREFIX") . 'district d on d.district_id = a.district_id')->join('left join ' . C("DB_PREFIX") . 'town e on e.town_id = a.town_id'); $where = array('user_id' => array('eq', $user_id)); $list = select_table($user_address, $where); return $list['data']; }
public function listShopAgency() { $username = trim(I('username')); $user_id = I('user_id'); if (!empty($username)) { $where['mobile'] = array('eq', $username); } $where['shop_serve_user_id'] = array('eq', $user_id); //获取pid的uid $table = M('shop')->alias('a')->field('(select sum(shop_serve_share_price) from ' . C("DB_PREFIX") . 'order where shop_serve_share_user_id = ' . $user_id . ' and shop_id = a.shop_id) as totalmoney ,b.mobile,a.create_time,b.first_login_time,a.shop_serve_user_id,b.user_id')->join('left join ' . C("DB_PREFIX") . 'user as b on b.user_id = a.principal_id'); $list = select_table($table, $where, I('pageNumber')); $table_ta = M('shop')->alias('a')->field('sum((select sum(shop_serve_share_price) from ' . C("DB_PREFIX") . 'order where shop_serve_share_user_id = ' . $user_id . ' and shop_id = a.shop_id)) as totalmoney')->where($where)->select(); //计算总收益 /*$totalListMoney = 0; foreach($list['data'] as $key => $val){ $totalListMoney += $val['totalmoney']; }*/ $this->assign('totalListMoney', $table_ta[0]['totalmoney']); $this->assign('list', $list); $this->display(); }
public function listShopAgent() { $username = trim(I('username')); $user_id = I('user_id'); if (!empty($username)) { $where['username'] = array('eq', $username); } $list = array(); $user_info = M('agent')->where(array('user_id' => array('eq', $user_id)))->find(); if ($user_info['province_id']) { $where['a.province_id'] = array('eq', $user_info['province_id']); } if ($user_info['city_id']) { $where['a.city_id'] = array('eq', $user_info['city_id']); } if ($user_info['district_id']) { $where['a.district_id'] = array('eq', $user_info['district_id']); } if ($user_info['town_id']) { $where['a.town_id'] = array('eq', $user_info['town_id']); } $table_shop = M('shop')->alias('a')->field('a.shop_name,b.mobile,a.create_time,a.principal_id,a.refer_user_id ,(select sum(operator_share_price) from ' . C("DB_PREFIX") . 'order where operator_share_user_id = ' . $user_id . ' and shop_id = a.shop_id) as totalmoney')->join('left join ' . C("DB_PREFIX") . 'user as b on b.user_id = a.principal_id'); $list = select_table($table_shop, $where, I('pageNumber')); $table_ta = M('shop')->alias('a')->field('sum((select sum(operator_share_price) from ' . C("DB_PREFIX") . 'order where operator_share_user_id = ' . $user_id . ' and shop_id = a.shop_id)) as totalmoney')->where($where)->select(); $this->assign('totalListMoney', $table_ta[0]['totalmoney']); $this->assign('list', $list); $this->display(); }
<?php require 'header.php'; ?> <div class="content container"> <div class="page-wrapper"> <div class="page-content"> <div class="row page-row"> <div class="course-wrapper col-md-8 col-sm-8"> <article class="course-item"> <div class="page-row"> <?php $result = select_table('imp_links'); $i = 1; if ($result) { foreach ($result as $row) { echo "<h2>{$i}. <a href={$row['url']}>{$row['title']}</a></h2>\n"; echo "<a href={$row['url']}>{$row['url']}</a>\n"; $i++; } } else { echo "<h2>Nothing Found<h2/>"; } ?> </div><!--//page-row--> </article><!--//course-item--> </div><!--//course-wrapper--> <div class="col-md-4 col-sm-4"> <!-- Here begin Sidebar -->
<?php require 'header.php'; ?> <div class="content container"> <div class="page-wrapper"> <div class="page-content"> <div class="row page-row"> <div class="course-wrapper col-md-8 col-sm-8"> <article class="course-item"> <div class="page-row"> <?php $result = select_table('events'); $i = 1; if ($result) { foreach ($result as $row) { $string = strip_tags($row['description']); echo "<h2>{$i}. <a href={$row['url']}>{$row['title']}</a></h2>\n"; echo "<h6>Date : {$row['event_date']}</h6>\n"; echo "<p>{$string}</p>\n"; echo "<a href={$row['url']}>{$row['url']}</a>\n"; $i++; } } else { echo "<h2>Nothing Found<h2/>"; } ?> </div><!--//page-row-->
function select_table($tables = array(), $dvr = 'dvr') { if (in_array($dvr, $tables)) { $num = trim($dvr, 'dvr') + 1; $dvr = 'dvr' . $num; if ($dvr == 'dvr1') { $dvr = 'dvr2'; } $dvr = select_table($tables, $dvr); } return $dvr; }
function show_important_link() { $result = select_table('imp_links'); foreach ($result as $row) { echo '<div class="blog-list-post clearfix">'; echo '<div class="blog-list-details">'; echo "<h5 class='blog-list-title'><a href={$row['url']}>{$row['title']}</a></h5>"; echo '</div>'; echo '</div>'; } }
/** * 提现转账 * @author xxx <*****@*****.**> */ public function index() { $status = I('status'); $name = I('name'); if (!empty($status)) { $where['withdraw_status'] = $status; } else { // $where['withdraw_status'] = array(array('neq',0),array('neq',1),array('neq',3),'OR'); $where['withdraw_status'] = array('not in', '0,1,3'); } if (!empty($name)) { $where['a.bank_name'] = array('like', "%{$name}%"); } //用户提现和商铺提现一起 /*$subQuery = M('Withdraw') ->alias('a') ->field('transaction_id,(select username from ' . C("DB_PREFIX") . 'user as b where a.user_id = b.user_id) as username,(select true_name from ' . C("DB_PREFIX") . 'user as b where a.user_id = b.user_id) as true_name,amount,withdraw_id,bank_name,bank_subbranch_name,card_number,apply_time,withdraw_status,withdraw_time,handle_mark') ->union('SELECT `transaction_id`, (select username from '.C("DB_PREFIX").'shop as d left join '.C("DB_PREFIX").'user as b on d.principal_id=b.user_id where a.shop_id = d.shop_id) as username, (select shop_name from '.C("DB_PREFIX").'shop as b where a.shop_id = b.shop_id) as true_name, `amount`,`withdraw_id`,`bank_name`,`bank_subbranch_name`,`card_number`,`apply_time`,`withdraw_status`,`withdraw_time`,`handle_mark` FROM 1dcq_shop_withdraw a')->buildSql(); $table = M()->field('transaction_id,username,true_name,amount,withdraw_id,bank_name,bank_subbranch_name,card_number,apply_time,withdraw_status,withdraw_time,handle_mark') ->table($subQuery.' n') ->order('apply_time desc');*/ //用户提现 /*$table = M('Withdraw') ->alias('a') ->field('transaction_id,(select username from ' . C("DB_PREFIX") . 'user as b where a.user_id = b.user_id) as username,(select true_name from ' . C("DB_PREFIX") . 'user as b where a.user_id = b.user_id) as true_name,amount,withdraw_id,bank_name,bank_subbranch_name,card_number,apply_time,withdraw_status,withdraw_time,handle_mark') ->order('apply_time desc');*/ //商铺提现 /*$table = M('shop_withdraw') ->alias('a') ->field('transaction_id,a.shop_id,bc.name as user_name,"shop" as c_table,(select username from '.C("DB_PREFIX").'shop as d left join '.C("DB_PREFIX").'user as b on d.principal_id=b.user_id where a.shop_id = d.shop_id) as username,(select user_type from '.C("DB_PREFIX").'shop as d left join '.C("DB_PREFIX").'user as b on d.principal_id=b.user_id where a.shop_id = d.shop_id) as user_type, (select shop_name from '.C("DB_PREFIX").'shop as b where a.shop_id = b.shop_id) as true_name,amount,withdraw_id,bc.bank_name,bc.bank_subbranch_name,bc.card_number,apply_time,withdraw_status,withdraw_time,handle_mark,bc.name') ->join('left join '.C("DB_PREFIX").'bank_card as bc on bc.card_number = a.card_number and bc.user_id=a.shop_id ') ->order('apply_time desc');*/ $table = M('shop_withdraw')->alias('a')->field('a.transaction_id,a.shop_id,bc.name as user_name,"shop" as c_table,u.username,u.user_type,true_name as true_name,a.amount,a.withdraw_id,bc.bank_name,bc.bank_subbranch_name,bc.card_number,a.apply_time,a.withdraw_status,a.withdraw_time,a.handle_mark,bc.name')->join('left join ' . C("DB_PREFIX") . 'shop as s on s.shop_id = a.shop_id')->join('left join ' . C("DB_PREFIX") . 'user as u on u.user_id = s.principal_id ')->join('left join ' . C("DB_PREFIX") . 'bank_card as bc on bc.card_number = a.card_number and bc.user_id=a.shop_id ')->union('select a.transaction_id,a.user_id as shop_id,bc.name as user_name,"user" as c_table,b.username,b.user_type, b.true_name,a.amount,a.withdraw_id,bc.bank_name,bc.bank_subbranch_name,bc.card_number,a.apply_time,a.withdraw_status,a.withdraw_time,a.handle_mark,bc.name from ' . C("DB_PREFIX") . 'withdraw as a left join ' . C("DB_PREFIX") . 'user as b on a.user_id = b.user_id left join ' . C("DB_PREFIX") . 'bank_card as bc on bc.card_number = a.card_number and bc.user_id=a.user_id')->buildSql(); $table = M()->field('transaction_id,shop_id,user_name,c_table,username,user_type,true_name,amount,withdraw_id,bank_name,bank_subbranch_name,card_number,apply_time,withdraw_status,withdraw_time,handle_mark,name')->table($table . ' a')->order('withdraw_id desc'); $list = select_table($table, $where, $_REQUEST['pageNumber']); foreach ($list['data'] as $key => $val) { switch ($val['user_type']) { case 0: $list['data'][$key]['user_type'] = '普通会员'; break; case 10: $list['data'][$key]['user_type'] = '店铺管理者'; break; case 20: $list['data'][$key]['user_type'] = '经销商'; break; case 30: $list['data'][$key]['user_type'] = '代理商'; break; case 40: $list['data'][$key]['user_type'] = '盘踞人员'; break; default: $list['data'][$key]['user_type'] = '未知类型'; break; } if ($list['data'][$key]['c_table'] == 'shop') { $info = M('shop_account')->where(array('shop_id' => $val['shop_id']))->find(); $list['data'][$key]['account'] = sprintf("%.2f", $info['amount']); // + $info['freeze_amount']; } else { $info = M('user_account')->where(array('user_id' => $val['shop_id']))->find(); $list['data'][$key]['account'] = sprintf("%.2f", $info['amount']); // + $info['freeze_amount']; } } $this->assign('list', $list); $this->assign('name', $name); $this->assign('status', $status); $this->display('transferList'); }
</div> <div class="border_meja_edit"> <img src="../img/building/<?php echo $building_img; ?> " style="visibility:hidden;" /> </div> <div id="content_new"> <?php $no = 1; $query = select_table($building_id); while ($row = mysql_fetch_array($query)) { switch ($row['table_status']) { case 0: $class_meja = "class='meja2'"; break; case 1: $class_meja = "class='meja3'"; break; } ?> <!-- <span class="tooltip tooltip-effect-1">--> <div id="makeMeDraggable_<?php echo $row['table_id']; ?> " class="meja1" style="background-color:<?php
public function info() { // if($_SESSION['column_name'] !="餐饮")$this->error('非法操作!'); $order_id = $_REQUEST['order_id']; $where = array('a.order_id' => array('eq', $order_id)); $info = M('order')->alias('a')->join('left join 1dcq_order_pay as c on c.order_id = a.order_id')->where($where)->field('(select username from ' . C("DB_PREFIX") . 'user as b where a.user_id = b.user_id) as username,a.*,c.pay_type')->find(); if (empty($info)) { //sum(standard_price*goods_number) as goods_settle_price $where = array('a.xorder_id' => array('eq', $order_id)); $info = M('xorder')->alias('a')->where($where)->join('left join 1dcq_order_pay as ae on ae.order_id = a.xorder_id')->field('xorder_id as order_id,user_info as mobile,a.*,ae.pay_type')->find(); $table = M('xorder_goods')->alias('a')->field('(select goods_name from ' . C("DB_PREFIX") . 'goods as b where a.goods_id = b.goods_id) as goods_name,sum(goods_number) as goods_number,(select order_discount from ' . C("DB_PREFIX") . 'xorder as c where a.xorder_id = c.xorder_id) as order_discount ,goods_settle_price,goods_required_price,a.xorder_id ,(select (select unit_name from ' . C("DB_PREFIX") . 'goods_unit where unit_id = c.unit_id) from ' . C("DB_PREFIX") . 'goods as c where c.goods_id = a.goods_id) as unit_name ,a.standard_price as standard_price')->group('xorder_goods_id'); $list = select_table($table, array('xorder_id' => array('eq', $order_id)), $_REQUEST['pageNumber']); $info['pay_type'] = $this->get_pay_type($info['order_id']); $info['order_status'] = $this->getOrderStatus($info['order_status']); $this->assign('fei_member', '2'); } else { //sum(standard_price*goods_number) as goods_settle_price //菜系 $table = M('order_goods')->alias('a')->field('(select goods_name from ' . C("DB_PREFIX") . 'goods as b where a.goods_id = b.goods_id) as goods_name,(select order_discount from ' . C("DB_PREFIX") . 'order as c where a.order_id = c.order_id) as order_discount ,sum(goods_number) as goods_number ,goods_settle_price, goods_required_price,a.order_id ,(select (select unit_name from ' . C("DB_PREFIX") . 'goods_unit where unit_id = c.unit_id) from ' . C("DB_PREFIX") . 'goods as c where c.goods_id = a.goods_id) as unit_name ,a.standard_price')->group('goods_id'); $list = select_table($table, array('order_id' => array('eq', $order_id)), $_REQUEST['pageNumber']); //echo $table->_sql(); $info['pay_type'] = $this->get_pay_type($info['shop_id'], $info['order_id']); $info['order_status'] = $this->getOrderStatus($info['order_status']); $this->assign('fei_member', '1'); } /*if($info['cashier_id'] == 0 && $info['cashier_id']!='') $info['cashier_id'] = '老板'; else if( $info['cashier_id']!='' ) { $w['employee_id'] = $info['cashier_id']; $d = M('shop_employee')->field('username')->where($w)->find(); $info['cashier_id'] = $d['username']; }*/ $shopInfo = M('shop')->where(array('shop_id' => I('shop_id')))->field('member_discount')->find(); $this->assign('shopInfo', $shopInfo); //var_dump($shopInfo); $this->assign('list', $list); $this->assign('info', $info); $this->display(); }
public function index() { $list = select_table(M('settings'), array('setting_key' => "remark"), I('pageNumber')); $this->assign('list', $list); $this->display(); }
/** * 提现转账 * @author xxx <*****@*****.**> */ public function transferList() { $status = I('status'); $name = I('name'); if (!empty($status)) { $where['withdraw_status'] = $status; } else { // $where['withdraw_status'] = array(array('neq',0),array('neq',1),array('neq',3),'OR'); $where['withdraw_status'] = array('not in', '0,1,3'); } if (!empty($name)) { $where['_string'] = '(a.transaction_id like "%' . $name . '%") OR ( a.bank_name like "%' . $name . '%") '; } else { $name = ""; } /*$table = M('Withdraw') ->alias('a') ->field('transaction_id,(select username from ' . C("DB_PREFIX") . 'user as b where a.user_id = b.user_id) as username,(select true_name from ' . C("DB_PREFIX") . 'user as b where a.user_id = b.user_id) as true_name,amount,withdraw_id,bank_name,bank_subbranch_name,card_number,apply_time,withdraw_status,withdraw_time,handle_mark');*/ $table = M('shop_withdraw')->alias('a')->field('transaction_id,"shop" as c_table,(select username from ' . C("DB_PREFIX") . 'shop as d left join ' . C("DB_PREFIX") . 'user as b on d.principal_id=b.user_id where a.shop_id = d.shop_id) as username, (select shop_name from ' . C("DB_PREFIX") . 'shop as b where a.shop_id = b.shop_id) as true_name,amount,withdraw_id,bank_name,bank_subbranch_name,card_number,apply_time,withdraw_status,withdraw_time,handle_mark')->order('apply_time desc'); $list = select_table($table, $where, I('pageNumber')); $this->assign('list', $list); $this->assign('name', $name); $this->assign('status', $status); $this->display(); }
public function showleft() { $like = I('like'); $likeleft = explode("_", $like); if ($likeleft[0] == "district") { $arraylist = M('province')->join('LEFT JOIN 1dcq_city on 1dcq_province.province_id=1dcq_city.province_id')->join('LEFT JOIN 1dcq_district on 1dcq_city.city_id=1dcq_district.city_id')->join('LEFT JOIN 1dcq_town on 1dcq_district.district_id=1dcq_town.district_id'); $where = '1dcq_town.district_id=' . $likeleft[1]; $arealike = select_table($arraylist, $where, I('pageNumber'), 100); $this->ajaxReturn($arealike); } }
public function statistics() { $product_id = I('product_id'); $status = intval(I('status')); $name = I('name'); if (!empty($product_id)) { if (!empty($status)) { $where['use_status'] = array('eq', $status); } if (!empty($name)) { } $where['marketing_goods_id'] = array('eq', $product_id); $table = M('marketing_order')->alias('a')->field('(select shop_name from ' . C("DB_PREFIX") . 'shop as b where b.shop_id = a.shop_id) as shop_name ,(select (select username from ' . C("DB_PREFIX") . 'user as ad where ad.user_id = ab.principal_id) from ' . C("DB_PREFIX") . 'shop as ab where ab.shop_id = a.shop_id) as username ,a.order_time,a.service_valid_from,a.service_valid_to,a.use_status,a.goods_price '); $list = select_table($table, $where, I('pageNumber')); $total = M('marketing_order')->where($where)->sum('goods_price'); } $this->assign('total', $total); $this->assign('list', $list); $this->display(); }