作者 刘朕
1 个管道 的构建 通过 耗费 20 秒

后台用户、订单列表优化,订单生成优化

... ... @@ -12,37 +12,34 @@ class PlatformordersController extends AdminBaseController{
*/
public function plat_list(){
if($this -> request -> isPost()){
$where = [
"indent_type" => 1
];
if(!empty($_POST['start_time']) && !empty($_POST['end_time'])){
$start_time = strtotime($_POST['start_time']);
$end_time = strtotime($_POST['end_time']);
$where['create_time'] = [['>=',$start_time],['<=',$end_time]];
}
if(!empty($_POST['keyword'])){
$where['order_number'] = $_POST['keyword'];
}
if(!empty($_POST['state'])){
$where['state'] = $_POST['state'];
}
$data = Db::name('indent') -> where($where) -> paginate(1000000);
$data1 = $data -> toArray();
if(count($data1['data'])!=0){
foreach ($data1['data'] as $key => $val){
$data1['data'][$key]['dizhi'] = Db::name('address') -> where('id',$val['indent_address']) -> find();
}
}
$this -> assign('data1',$data1['data']);
}else{
$data = Db::name('indent') -> where('indent_type','1') -> paginate(12);
$data1 = $data -> toArray();
$param = $this->request->param();
$where = [
"indent_type" => 1
];
if(!empty($param['start_time']) && !empty($param['end_time'])){
$start_time = strtotime($param['start_time']);
$end_time = strtotime($param['end_time']);
$where['create_time'] = [['>=',$start_time],['<=',$end_time]];
}
if(!empty($param['keyword'])){
$where['order_number|name|phone'] = ['like','%'.$param['keyword'].'%'];
}
if(!empty($param['state'])){
$where['state'] = $param['state'];
}
$data = Db::name('indent') -> where($where)->order('create_time','DESC') -> paginate(12);
$data->appends($param);
$data1 = $data -> toArray();
if(count($data1['data'])!=0){
foreach ($data1['data'] as $key => $val){
$data1['data'][$key]['dizhi'] = Db::name('address') -> where('id',$val['indent_address']) -> find();
}
$this -> assign('data1',$data1['data']);
}
$this -> assign('data1',$data1['data']);
$this->assign('start_time', isset($param['start_time']) ? $param['start_time'] : '');
$this->assign('end_time', isset($param['end_time']) ? $param['end_time'] : '');
$this->assign('keyword', isset($param['keyword']) ? $param['keyword'] : '');
$this->assign('state', isset($param['state']) ? $param['state'] : '');
$this -> assign('data',$data);
return $this -> fetch();
... ... @@ -57,15 +54,17 @@ class PlatformordersController extends AdminBaseController{
$indent_id = $id['id'];
$data_goods = Db::name('indent_goods') -> where('indent_id',$indent_id) -> select();
$data_in = Db::name('indent') -> where('id',$indent_id) -> find();
$this -> assign('data_goods',$data_goods);
$this -> assign('data_in',$data_in);
//地址查询
$address = Db::name('address') -> where("id",$data_in['indent_address']) -> find();
if(!empty($address)){
if($address){
$data_in['name'] = $address['name'];
$data_in['phone'] = $address['phone'];
$this -> assign('address',$address);
}else{
$this -> assign('address',null);
}
$this -> assign('data_goods',$data_goods);
$this -> assign('data_in',$data_in);
return $this -> fetch();
... ... @@ -85,11 +84,132 @@ class PlatformordersController extends AdminBaseController{
public function out()
{
// 进行查询条件的处理
$param = $this->request->param();
$where = [
"indent_type" => 1
];
if(!empty($param['start_time']) && !empty($param['end_time'])){
$start_time = strtotime($param['start_time']);
$end_time = strtotime($param['end_time']);
$where['create_time'] = [['>=',$start_time],['<=',$end_time]];
}
if(!empty($param['keyword'])){
$where['order_number|name|phone'] = ['like','%'.$param['keyword'].'%'];
}
if(!empty($param['state'])){
$where['state'] = $param['state'];
}
$data = Db::name('indent') -> where($where)->order('create_time','DESC') -> paginate(12);
$data->appends($param);
$data1 = $data -> toArray();
if(count($data1['data'])!=0){
foreach ($data1['data'] as $key => $val){
$data1['data'][$key]['dizhi'] = Db::name('address') -> where('id',$val['indent_address']) -> find();
}
}
$this->expList($data1['data']);
}
// 数据导出
public function expList($array){
//导出Excel
$objPHPExcel = new \PHPExcel();
//Add some data
$objPHPExcel->setActiveSheetIndex(0)
->setCellValue('A1', '序号')
->setCellValue('B1', '订单号')
->setCellValue('C1', '姓名')
->setCellValue('D1', '手机号')
->setCellValue('E1', '收货地址')
->setCellValue('F1', '数量')
->setCellValue('G1', '价钱')
->setCellValue('H1', '订单状态')
->setCellValue('I1', '创建时间');
// sheet个数
$sheet_index = 0;
$sheet_count = 1;
if(count($array) > 65535) {
$sheet_count = ceil(count($array)/65535);
for ($j = 1; $j < $sheet_count; $j++) {
$objPHPExcel->createSheet();
$objPHPExcel->setActiveSheetIndex($sheet_index+$j)
->setCellValue('A1', '序号')
->setCellValue('B1', '订单号')
->setCellValue('C1', '姓名')
->setCellValue('D1', '手机号')
->setCellValue('E1', '收货地址')
->setCellValue('F1', '数量')
->setCellValue('G1', '价钱')
->setCellValue('H1', '订单状态')
->setCellValue('I1', '创建时间');
}
}
// 设置单元格宽度
$objPHPExcel->getActiveSheet()->getColumnDimension('A')->setWidth(10);
$objPHPExcel->getActiveSheet()->getColumnDimension('B')->setWidth(25);
$objPHPExcel->getActiveSheet()->getColumnDimension('C')->setWidth(15);
$objPHPExcel->getActiveSheet()->getColumnDimension('D')->setWidth(20);
$objPHPExcel->getActiveSheet()->getColumnDimension('E')->setWidth(50);
$objPHPExcel->getActiveSheet()->getColumnDimension('F')->setWidth(10);
$objPHPExcel->getActiveSheet()->getColumnDimension('G')->setWidth(15);
$objPHPExcel->getActiveSheet()->getColumnDimension('H')->setWidth(15);
$objPHPExcel->getActiveSheet()->getColumnDimension('I')->setWidth(25);
$i = 2;
// 计数器
$cnt = 0;
// 每隔$limit行,刷新一下输出buffer,不要太大,也不要太小
$limit = 35000;
foreach ($array as $k=>$v) {
$cnt ++;
if ($limit == $cnt) { //刷新一下输出buffer,防止由于数据过多造成问题
ob_flush();
flush();
$cnt = 0;
}
$state = '待付款';
if($v['state'] == 1) {
$state = '已付款';
}
if($v['state'] == 2) {
$state = '未完成';
}
if($v['state'] == 3) {
$state = '已完成';
}
$objPHPExcel->setActiveSheetIndex($sheet_index)
->setCellValue('A' . $i, $v['id'])
->setCellValue('B' . $i, $v['order_number'])
->setCellValue('C' . $i, $v['name'])
->setCellValue('D' . $i, $v['phone'])
->setCellValue('E' . $i, $v['dizhi']['region'].' '.$v['dizhi']['detailed'])
->setCellValue('F' . $i, $v['book_num'])
->setCellValue('G' . $i, $v['money'])
->setCellValue('H' . $i, $state)
->setCellValue('I' . $i, date('Y-m-d H:i:s',$v['create_time']));
$i++;
if($k == ($sheet_index+1)*65535) {
$i = 2;
$sheet_index++;
}
}
$filename = '平台订单数据'. date('Y-m-d').'.xls';
ob_end_clean();
header('Content-Type: text/csv');
// header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment;filename="' . $filename . '"');
header('Cache-Control: max-age=0');
$objWriter = \PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
$objWriter->save('php://output');
exit;
}
}
\ No newline at end of file
... ...
... ... @@ -11,25 +11,26 @@ class SalesmanController extends AdminBaseController{
* 业务员列表
*/
public function salesman_list(){
if($this -> request -> isPost()){
$where = [
'a.status' => 2
];
if(!empty($_POST['start_time']) && !empty($_POST['end_time'])){
$start_time = strtotime($_POST['start_time']);
$end_time = strtotime($_POST['end_time']);
$where['audit_time'] = [['>=',$start_time],['<=',$end_time]];
}
if(!empty($_POST['keyword'])){
$keyword = $_POST['keyword'];
$where['b.phone'] = $keyword;
}
$data = Db::name('my_user') -> alias('a') -> field("a.uid,a.id,a.balance,a.audit_time,a.is_pro,b.phone") -> join('sale_audit b','a.uid = b.uid','LEFT') -> where($where) -> group('a.id') -> paginate(1000000);
}else{
$data = Db::name('my_user') -> alias('a') -> field("a.uid,a.id,a.balance,a.audit_time,a.is_pro,b.phone") -> join('sale_audit b','a.uid = b.uid','LEFT') -> where('a.status',2) -> group('a.id') -> paginate(12);
$param = $this->request->param();
$where = [
'a.status' => 2
];
if(!empty($param['start_time']) && !empty($param['end_time'])){
$start_time = strtotime($param['start_time']);
$end_time = strtotime($param['end_time']);
$where['audit_time'] = [['>=',$start_time],['<=',$end_time]];
}
if(!empty($param['keyword'])){
$keyword = $param['keyword'];
$where['b.phone'] = $keyword;
}
$data = Db::name('my_user')->alias('a')
->field("a.uid,a.id,a.balance,a.audit_time,a.is_pro,b.phone")
->join('sale_audit b','a.uid = b.uid','LEFT')
->where('a.status',2)
->group('a.id')
->order(['a.balance'=>'DESC','a.create_time'=>'DESC'])
->paginate(12);
$data_arr = $data -> toArray();
/* array(1) {
... ... @@ -46,6 +47,11 @@ class SalesmanController extends AdminBaseController{
$data_user = Db::name('user') -> where('id',$val['uid']) -> find();
$data_arr['data'][$key]['name'] = $data_user['user_nickname'];
$data_arr['data'][$key]['money'] = $data_money['platform_ratio'];
// 获取提现数据
$ti_count = Db::name('money_expend')->where('uid',$val['uid'])->where('state',1)->sum('money');// 已提金额
$unti_count = Db::name('money_expend')->where('uid',$val['uid'])->where('state',0)->sum('money');// 提现审核中金额
$data_arr['data'][$key]['ti_count'] = $ti_count;
$data_arr['data'][$key]['all_count'] = $ti_count + $unti_count + $val['balance'];
}
$this -> assign('data_arr',$data_arr['data']);
$this -> assign('data',$data);
... ... @@ -384,30 +390,25 @@ class SalesmanController extends AdminBaseController{
public function salesman_money(){
$uid = $this -> request -> param();
$data = Db::name('money_income') -> alias('a') -> join("indent b","a.indent_id=b.id","LEFT") -> where('a.uid',$uid['uid']) -> select() -> toArray();
/* if(!empty($data)){
foreach ($data as $key=>$val){
if($val['type']==2){
$book_name = Db::name('indent_goods') -> where('indent_id',$val['indent_id']) -> select() -> toArray();
$data[$key]['book_name'] =
$data = Db::name('money_income') -> where('uid',$uid['uid']) -> select() -> toArray();
$money_ratio = Db::name('money_ratio')->where('id',1)->find();
if(!empty($data)){
foreach ($data as $key => $val){
if($val['type'] == 2){
$data[$key]['indent'] = Db::name('indent') -> where('id',$val['indent_id']) -> find();
$indent_good = Db::name('indent_goods') -> where('indent_id',$val['indent_id']) -> select() -> toArray();
$indent_goods = '';
foreach ($indent_good as $key1 => $val1){
$indent_goods .= $val1['book_name'].',';
}
$data[$key]['indent_good'] = $indent_goods;
}else{
$data[$key]['indent'] = Db::name('indent') -> where('id',$val['indent_id']) -> find();
$data[$key]['indent_good'] = $val['book_name'];
}
$data[$key]['money'] = $val['money'] * $money_ratio['salesman_ratio'];
}
}
dump($data);die;*/
if(!empty($data)){
foreach ($data as $key => $val){
if($val['type'] == 2){
$indent_good = Db::name('indent_goods') -> where('indent_id',$val['indent_id']) -> select() -> toArray();
$indent_goods = '';
foreach ($indent_good as $key1 => $val1){
$indent_goods .= $val1['book_name'].',';
}
$data[$key]['indent_good'] = $indent_goods;
}else{
$data[$key]['indent_good'] = $val['book_name'];
}
}
}
$this -> assign('data',$data);
return $this -> fetch();
... ...
... ... @@ -12,55 +12,68 @@ class SalesmanorderController extends AdminBaseController{
* 业务员订单列表
*/
public function sale_order_list(){
if($this -> request -> isPost()){
$where = [
'indent_type' => 2
];
if(!empty($_POST['start_time']) && !empty($_POST['end_time'])){
$start_time = strtotime($_POST['start_time']);
$end_time = strtotime($_POST['end_time']);
$where['create_time'] = [['>=',$start_time],['<=',$end_time]];
}
if(!empty($_POST['keyword'])){
$where['order_number'] = $_POST['keyword'];
}
if(!empty($_POST['state'])){
$where['state'] = $_POST['state'];
}
if(!empty($_POST['uid'])){
$where['salesman_uid'] = $_POST['uid'];
}
if(!empty($_POST['school'])){
$where['school'] = $_POST['school'];
}
if(!empty($_POST['grade'])){
$where['grade'] = $_POST['grade'];
}
$data = Db::name('indent') -> where($where) -> paginate(1000000);
$data_arr = $data -> toArray();
}else{
$data = Db::name('indent') -> where('indent_type',2) -> paginate(12);
$data_arr = $data -> toArray();
$param = $this->request->param();
$where = [
'indent_type' => 2
];
if(!empty($param['keyword'])){
$where['order_number|name|phone'] = ['like','%'.trim($param['keyword']).'%'];
}
if(!empty($param['state'])){
$where['state'] = $param['state'];
}
if(!empty($param['uid'])){
$where['salesman_uid'] = $param['uid'];
}
if(!empty($param['school'])){
$where['school'] = $param['school'];
}
if(!empty($param['grade'])){
$where['grade'] = $param['grade'];
}
$data = Db::name('indent') -> where($where)->order('create_time','DESC') -> paginate(12);
$data->appends($param);
$data_arr = $data -> toArray();
$money = 0;
foreach($data_arr['data'] as $key => $val){
$data_arr['data'][$key]['grade_class'] = $val['school'].'-'.$val['grade'].$val['class'];
}
foreach ($data_arr['data'] as $key => $val){
$nickname = '';
if($val['salesman_uid']) {
$nickname = Db::name('user')->where('id',$val['salesman_uid'])->value('user_nickname');
}
$data_arr['data'][$key]['nickname'] = $nickname;
if($val['state'] == 2 || $val['state'] == 3 || $val['state'] == 5){
$money += $data_arr['data'][$key]['money'];
}
}
// 学校筛选列表
$data_school = Db::name('school') -> group('school') -> select() -> toArray();
foreach($data_school as $key => $val){
$school[$key] = $val['school'];
}
// 业务员筛选列表
$uid = Db::name('my_user') -> alias('a') -> join('user b','a.uid = b.id','LEFT') -> where('a.status = 2') -> select();
/* foreach($uid as $key => $val){
$sales[$key]['uid'] = $val['id'];
$sales[$key]['name'] = $val['user_nickname'];
}*/
// 年级筛选列表
$grade_array = [
'一年级' => '一年级',
'二年级' => '二年级',
'三年级' => '三年级',
'四年级' => '四年级',
'五年级' => '五年级',
'六年级' => '六年级',
'初一' => '初一',
'初二' => '初二',
'初三' => '初三',
'高一' => '高一',
'高二' => '高二',
'高三' => '高三'
];
$this->assign('keyword', isset($param['keyword']) ? trim($param['keyword']) : '');
$this->assign('state', isset($param['state']) ? $param['state'] : '');
$this->assign('uid', isset($param['uid']) ? $param['uid'] : '');
$this->assign('school_val', isset($param['school']) ? $param['school'] : '');
$this->assign('grade', isset($param['grade']) ? $param['grade'] : '');
$this->assign('grade_array', $grade_array);
$this -> assign('data_arr',$data);
$this -> assign('school',$school);
$this -> assign('sales',$uid);
... ...
... ... @@ -10,40 +10,60 @@ class UsersController extends AdminBaseController{
* 显示用户列表
*/
public function user_list(){
if($this -> request -> isPost()){
$where = [
'a.create_time' => ['>=', 0],
];
if(!empty($_POST['start_time']) && !empty($_POST['end_time'])){
$start_time = strtotime($_POST['start_time']);
$end_time = strtotime($_POST['end_time']);
$where['a.create_time'] = [['>=',$start_time],['<=',$end_time]];
}
if(!empty($_POST['keyword'])){
$keyword = $_POST['keyword'];
$where['b.user_nickname'] = ['like',"%$keyword%"];
$param = $this->request->param();
$where = [
'a.create_time' => ['>=', 0],
];
if(!empty($param['keyword'])){
$keyword = $param['keyword'];
$where['b.user_nickname'] = ['like',"%$keyword%"];
}
if(!empty($param['id'])){
$where['a.id'] = ['eq',$param['id']];
}
if(!empty($param['identity'])){
if($param['identity'] == -1){
$where['a.status'] = ['eq',0];
}else{
$where['a.status'] = ['eq',$param['identity']];
}
if(!empty($_POST['id'])){
$where['a.id'] = ['eq',$_POST['id']];
}
$data = Db::name('my_user') -> alias('a')
->field('a.*,b.user_nickname')
->join('user b','a.uid = b.id','LEFT')
->order(['a.balance'=>'DESC','a.create_time'=>'DESC'])
->paginate(12);
$list = $data->items();
foreach ($list as $k=>$v) {
// 获取邀请人昵称
$invite_nickname = '';
if($v['pid']) {
$invite = Db::name('my_user')->alias('m')
->field('u.user_nickname')
->join('user u','m.uid = u.id')
->where('m.id',$v['pid'])
->find();
$invite_nickname = $invite['user_nickname'];
}
if($_POST['identity'] != ""){
if($_POST['identity'] == -1){
$where['a.status'] = ['eq',0];
}else{
$where['a.status'] = ['eq',$_POST['identity']];
}
$list[$k]['invite_nickname'] = $invite_nickname;
// 获取提现数据
$ti_count = Db::name('money_expend')->where('uid',$v['uid'])->where('state',1)->sum('money');// 已提金额
$unti_count = Db::name('money_expend')->where('uid',$v['uid'])->where('state',0)->sum('money');// 提现审核中金额
$list[$k]['ti_count'] = $ti_count;
$list[$k]['all_count'] = $ti_count + $unti_count + $v['balance'];
// 获取邀请人数
$invite_count = 0;
if(in_array($v['status'],[2,3])) {
$invite_count = Db::name('my_user')->where('pid',$v['uid'])->count();
}
$data = Db::name('my_user') -> alias('a') -> field('a.*,b.user_nickname') -> join('user b','a.uid = b.id','LEFT') -> where($where) -> paginate(1000000);
}else{
$data = Db::name('my_user') -> alias('a') -> field('a.*,b.user_nickname') -> join('user b','a.uid = b.id','LEFT') -> paginate(12);
$list[$k]['invite_count'] = $invite_count;
}
$this -> assign('data',$data);
$this->assign('user_nickname',!empty($_POST['user_nickname']) ? $_POST['user_nickname'] : '');
$this->assign('status',!empty($_POST['status']) ? $_POST['status'] : '');
$this->assign('id',!empty($_POST['id']) ? $_POST['id'] : '');
return $this -> fetch();
$this->assign('list',$list);
$this->assign('data',$data);
$this->assign('user_nickname',!empty($param['user_nickname']) ? $param['user_nickname'] : '');
$this->assign('status',!empty($param['status']) ? $param['status'] : '');
$this->assign('id',!empty($param['id']) ? $param['id'] : '');
return $this->fetch();
}
... ... @@ -150,6 +170,8 @@ class UsersController extends AdminBaseController{
$uid = $this -> request -> param();
$data = Db::name('money_income') -> where('uid',$uid['uid']) -> select() -> toArray();
$my_user = Db::name('my_user')->where('uid',$uid['uid'])->find();
$money_ratio = Db::name('money_ratio')->where('id',1)->find();
if(!empty($data)){
foreach ($data as $key => $val){
if($val['type'] == 2){
... ... @@ -164,6 +186,12 @@ class UsersController extends AdminBaseController{
$data[$key]['indent'] = Db::name('indent') -> where('id',$val['indent_id']) -> find();
$data[$key]['indent_good'] = $val['book_name'];
}
if($my_user['status'] == 2) {
$data[$key]['money'] = $val['money'] * $money_ratio['salesman_ratio'];
}
if($my_user['status'] == 3) {
$data[$key]['money'] = $val['money'] * $money_ratio['teacher_ratio'];
}
}
}
$this -> assign('data',$data);
... ... @@ -171,28 +199,4 @@ class UsersController extends AdminBaseController{
}
}
\ No newline at end of file
... ...
... ... @@ -212,9 +212,15 @@ class OrderpageController extends WeChatBaseController{
* 平台商品去支付时 更新买家留言
*/
public function goods_leave_word_update(){
$_POST['is_courier'] = 2;
$data = Db::name('indent') -> update($_POST);
$param = $this->request->param();
$param['is_courier'] = 2;
$address = Db::name('address')->where('id',$param['indent_address'])->find();
if(!$address) {
return false;
}
$param['name'] = $address['name'];
$param['phone'] = $address['phone'];
$data = Db::name('indent') -> update($param);
return true;
}
... ...
... ... @@ -19,18 +19,19 @@
<input type="text" class="form-control js-bootstrap-datetime" name="end_time"
value="{$end_time|default=''}"
style="width: 140px;" autocomplete="off"> &nbsp;
关键字:
订单搜索:
<input type="text" class="form-control" name="keyword" style="width: 200px;"
value="{$keyword|default=''}" placeholder="请输入订单号...">
value="{$keyword|default=''}" placeholder="请输入订单号/姓名/手机号">
订单状态:
<select name="state" class="form-control">
<option value="">全部</option>
<option value="3">已完成</option>
<option value="2">未完成</option>
<option value="4">待付款</option>
<option value="3" <eq name="state" value="3">selected</eq> >已完成</option>
<option value="2" <eq name="state" value="2">selected</eq> >未完成</option>
<option value="4" <eq name="state" value="4">selected</eq> >待付款</option>
</select>
<input type="submit" class="btn btn-primary" value="搜索"/>
<a class="btn btn-danger" href="{:url('Platformorders/plat_list')}">清空</a>
<input type="button" class="btn btn-primary" id="excel" value="导出"/>
</form>
<table class="table table-bordered">
<thead>
... ... @@ -52,8 +53,8 @@
<tr class="tr{$vo.id}">
<td>{$vo.id}</td>
<td>{$vo.order_number}</td>
<td>{$vo.dizhi.name}</td>
<td>{$vo.dizhi.phone}</td>
<td>{$vo.name}</td>
<td>{$vo.phone}</td>
<td>{$vo.dizhi['region']} {$vo.dizhi['detailed']}</td>
<td>{$vo.book_num}</td>
<td>{$vo.money}</td>
... ... @@ -92,6 +93,38 @@
});
}
}
function reloadPage(win) {
win.location.reload();
}
$('#excel').click(function () {
var url1 = "{:url('out')}";
var url2 = url1.split('.',5);
var start_time = $('input[name=start_time]').val();
var end_time = $('input[name=end_time]').val();
var state = $('select[name=state]').val();
var keyword = $('input[name=keyword]').val();
var param = '/excel/1';
var ids = [];
$('.js-check').each(function(index,element) {
if($(this).prop('checked') == true) {
ids.push($(this).val());
}
});
if(start_time.length > 0) {
param += '/start_time/'+start_time;
}
if(end_time.length > 0) {
param += '/end_time/'+end_time;
}
if(state.length > 0) {
param += '/state/'+state;
}
if(keyword.length > 0) {
param += '/keyword/'+keyword;
}
var url = url2[0]+param+'.html';
window.open(url);
});
</script>
</body>
</html>
... ...
... ... @@ -31,6 +31,8 @@
<th>序号</th>
<th>微信昵称</th>
<th>手机号</th>
<th>历史总收入</th>
<th>已提金额</th>
<th>余额</th>
<th>平台佣金比例</th>
<th>创建时间</th>
... ... @@ -43,6 +45,8 @@
<td>{$vo.id}</td>
<td>{$vo.name}</td>
<td>{$vo.phone}</td>
<td>{$vo.all_count}</td>
<td>{$vo.ti_count}</td>
<td>{$vo.balance}</td>
<td>{$vo.money}</td>
<td>{$vo.audit_time|date="Y-m-d H:i:s",###}</td>
... ...
... ... @@ -27,7 +27,7 @@
团购收入
</if>
</td>
<td>{$vo.order_number}</td>
<td>{$vo.indent.order_number}</td>
<td>
{$vo.indent_good}
</td>
... ...
... ... @@ -12,53 +12,37 @@
<li class="active"><a href="#">业务员订单列表</a></li>
</ul>
<form class="well form-inline margin-top-20" method="post" action="{:url('Salesmanorder/sale_order_list')}">
时间:
<input type="text" class="form-control js-bootstrap-datetime" name="start_time"
value="{$start_time|default=''}"
style="width: 140px;" autocomplete="off">-
<input type="text" class="form-control js-bootstrap-datetime" name="end_time"
value="{$end_time|default=''}"
style="width: 140px;" autocomplete="off"> &nbsp;
关键字:
<input type="text" class="form-control" name="keyword" style="width: 200px;"
value="{$keyword|default=''}" placeholder="请输入订单号...">
value="{$keyword|default=''}" placeholder="请输入订单号/姓名/手机号">
订单状态:
<select name="state" class="form-control">
<option value="">全部</option>
<option value="3">已完成</option>
<option value="2">未完成</option>
<option value="4">待付款</option>
<option value="5">已发货</option>
<option value="3" <eq name="state" value="3">selected</eq> >已完成</option>
<option value="2" <eq name="state" value="2">selected</eq> >未完成</option>
<option value="4" <eq name="state" value="4">selected</eq> >待付款</option>
<option value="5" <eq name="state" value="5">selected</eq> >已发货</option>
</select>
业务员:
<select name="uid" class="form-control">
<option value="">全部</option>
<volist name="sales" id="vo">
<option value="{$vo.uid}">{$vo.user_nickname}</option>
<option value="{$vo.uid}" <eq name="uid" value="$vo['uid']">selected</eq> >{$vo.user_nickname}</option>
</volist>
</select>
学校:
<select name="school" class="form-control">
<option value="">全部</option>
<volist name="school" id="val">
<option value="{$val}">{$val}</option>
<option value="{$val}" <eq name="school_val" value="$val">selected</eq> >{$val}</option>
</volist>
</select>
年级:
<select name="grade" class="form-control">
<option value="">全部</option>
<option value="一年级">一年级</option>
<option value="二年级">二年级</option>
<option value="三年级">三年级</option>
<option value="四年级">四年级</option>
<option value="五年级">五年级</option>
<option value="六年级">六年级</option>
<option value="初一">初一</option>
<option value="初二">初二</option>
<option value="初三">初三</option>
<option value="高一">高一</option>
<option value="高二">高二</option>
<option value="高三">高三</option>
<volist name="grade_array" id="vo">
<option value="{$vo}" <eq name="grade" value="$vo">selected</eq> >{$vo}</option>
</volist>
</select>
<input type="submit" class="btn btn-primary" value="搜索"/>
<a class="btn btn-danger" href="{:url('Salesmanorder/sale_order_list')}">清空</a>
... ... @@ -74,6 +58,7 @@
<th>姓名</th>
<th>手机号</th>
<th>地区</th>
<th>业务员</th>
<th>数量</th>
<th>价钱</th>
<th>学校-班级</th>
... ... @@ -90,6 +75,7 @@
<td>{$vo.name}</td>
<td>{$vo.phone}</td>
<td>{$vo.region}</td>
<td>{$vo.nickname}</td>
<td>{$vo.book_num}</td>
<td>{$vo.money}</td>
<td>{$vo.grade_class}</td>
... ...
... ... @@ -44,14 +44,19 @@
<th>微信昵称</th>
<th>身份</th>
<th>手机号</th>
<th>邀请人序号</th>
<th>邀请人姓名</th>
<th>邀请人</th>
<th>邀请人数</th>
<th>历史总收入</th>
<th>已提金额</th>
<th>余额</th>
<th>创建时间</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<volist name="data" id="val">
<volist name="list" id="val">
<tr>
<td>{$val.id}</td>
<td>{$val.user_nickname}</td>
... ... @@ -65,7 +70,12 @@
<td>自由人</td>
</if>
<td>{$val.phone}</td>
<td>{$val.pid}</td>
<td>{$val.invite_nickname}</td>
<td>{$val.inviter_phone}</td>
<td>{$val.invite_count}</td>
<td>{$val.all_count}</td>
<td>{$val.ti_count}</td>
<td>{$val.balance}</td>
<if condition="$val.status eq 2">
<td>{$val.audit_time|date="Y-m-d H:i:s",###}</td>
... ...
... ... @@ -152,10 +152,11 @@ class Bootstrap extends Paginator
);
} else {
return sprintf(
'%s %s %s',
'%s %s %s %s',
$this->getPreviousButton(),
$this->getLinks(),
$this->getNextButton()
$this->getNextButton(),
$this->getCount()
);
}
}
... ... @@ -239,4 +240,14 @@ class Bootstrap extends Paginator
}
/**
* 数据总数
*
* @return string
*/
protected function getCount()
{
return '<li style="border: none;"><span style="border: none;">总共 ' . $this->total . ' 条记录</span></li>';
}
}
... ...