修改订单列表查询

This commit is contained in:
luofei 2024-06-05 17:46:42 +08:00
parent 2cb062c39b
commit 1407beb266
4 changed files with 14 additions and 3 deletions

View File

@ -51,6 +51,9 @@ class StoreOrderLists extends BaseAdminDataLists implements ListsSearchInterface
$query->whereTime('create_time', '>=', $this->params['start_time']);
})
->when(!empty($this->params['end_time']), function ($query) {
if ($this->params['end_time'] == $this->params['start_time']) {
$this->params['end_time'] = strtotime($this->params['end_time']) + 86399;
}
$query->whereTime('create_time', '<=', $this->params['end_time']);
})
->when(!empty($this->request->adminInfo['store_id']), function ($query) {
@ -85,6 +88,9 @@ class StoreOrderLists extends BaseAdminDataLists implements ListsSearchInterface
$query->whereTime('create_time', '>=', $this->params['start_time']);
})
->when(!empty($this->params['end_time']), function ($query) {
if ($this->params['end_time'] == $this->params['start_time']) {
$this->params['end_time'] = strtotime($this->params['end_time']) + 86399;
}
$query->whereTime('create_time', '<=', $this->params['end_time']);
})
->count();

View File

@ -48,6 +48,9 @@ class StoreRefundOrderLists extends BaseAdminDataLists implements ListsSearchInt
$query->whereTime('refund_reason_time', '>=', $this->params['start_time']);
})
->when(!empty($this->params['end_time']), function ($query) {
if ($this->params['end_time'] == $this->params['start_time']) {
$this->params['end_time'] = strtotime($this->params['end_time']) + 86399;
}
$query->whereTime('refund_reason_time', '<=', $this->params['end_time']);
})
->field(['id', 'store_id', 'staff_id', 'order_id', 'pay_price', 'pay_time', 'pay_type', 'status', 'uid', 'refund_status', 'refund_type', 'refund_reason_wap', 'refund_reason_time', 'refund_reason_wap_explain', 'refund_reason_wap_img'])
@ -80,6 +83,9 @@ class StoreRefundOrderLists extends BaseAdminDataLists implements ListsSearchInt
$query->whereTime('refund_reason_time', '>=', $this->params['start_time']);
})
->when(!empty($this->params['end_time']), function ($query) {
if ($this->params['end_time'] == $this->params['start_time']) {
$this->params['end_time'] = strtotime($this->params['end_time']) + 86399;
}
$query->whereTime('refund_reason_time', '<=', $this->params['end_time']);
})
->count();

View File

@ -33,7 +33,7 @@ class ListsValidate extends BaseValidate
'page_type' => 'in:0,1',
'order_by' => 'in:desc,asc',
'start_time' => 'date',
'end_time' => 'date|gt:start_time',
'end_time' => 'date|egt:start_time',
'start' => 'number',
'end' => 'number',
'export' => 'in:1,2',

View File

@ -7,7 +7,6 @@ use app\admin\lists\store_order\StoreOrderLists;
use app\common\controller\Definitions;
use app\common\enum\PayEnum;
use app\common\logic\SystemStoreStaffLogic;
use app\common\model\store_order\StoreOrder;
use app\store\controller\BaseAdminController;
use app\common\logic\store_order\StoreOrderLogic;
use app\store\validate\store_order\StoreOrderValidate;