Update ShopOrderSend.php

This commit is contained in:
邹景立 2021-03-17 18:05:37 +08:00
parent ce51012362
commit 767b35f65d

View File

@ -33,7 +33,7 @@ class ShopOrderSend extends Controller
$this->address = sysdata('ordersend');
// 状态数据统计
$this->total = ['t0' => 0, 't1' => 0, 't2' => 0, 'ta' => 0];
$db = $this->app->db->name('ShopOrder')->whereIn('status', [4, 5, 6]);
$db = $this->app->db->name('ShopOrder')->whereIn('status', [4, 5, 6])->where(['truck_type' => 1]);
$query = $this->app->db->name($this->table)->whereRaw("order_no in {$db->field('order_no')->buildSql()}");
foreach ($query->fieldRaw('status,count(1) total')->group('status')->cursor() as $vo) {
$this->total["t{$vo['status']}"] = $vo['total'];
@ -47,8 +47,8 @@ class ShopOrderSend extends Controller
$db = $this->_query('DataUser')->like('phone#user_phone,nickname#user_nickname')->db();
if ($db->getOptions('where')) $query->whereRaw("uid in {$db->field('id')->buildSql()}");
// 订单搜索查询
$db = $this->_query('ShopOrder')->whereIn('status', [4, 5, 6])->db();
if ($db->getOptions('where')) $query->whereRaw("order_no in {$db->field('order_no')->buildSql()}");
$db = $this->_query('ShopOrder')->whereIn('status', [4, 5, 6])->where(['truck_type' => 1])->db();
$query->whereRaw("order_no in {$db->field('order_no')->buildSql()}");
// 列表选项卡状态
if (is_numeric($this->type = trim(input('type', 'ta'), 't'))) {
$query->where(['status' => $this->type]);