feat(StoreOrderCartInfoTwoLists): 增加导出订单功能
This commit is contained in:
parent
bd113c4ea2
commit
28c25f9b32
@ -65,6 +65,7 @@ class StoreOrderCartInfoTwoLists extends BaseAdminDataLists implements ListsSear
|
||||
$this->searchWhere[] = ['create_time', 'between', [strtotime(date('Y-m-d 00:00:00')), strtotime(date('Y-m-d 23:59:59'))]];
|
||||
}
|
||||
$is_group=$this->request->get('is_group');
|
||||
$export=$this->request->get('export',0);
|
||||
$this->searchWhere[] = ['is_pay', '=', 1];
|
||||
$this->searchWhere[] = ['status', '>=', 0];
|
||||
$query = StoreOrderCartInfo::where($this->searchWhere);
|
||||
@ -74,10 +75,14 @@ class StoreOrderCartInfoTwoLists extends BaseAdminDataLists implements ListsSear
|
||||
$query->field('store_id,product_id,price,total_price,cart_num,create_time,uid');
|
||||
}
|
||||
return $query->limit($this->limitOffset, $this->limitLength)
|
||||
->select()->each(function ($item) use($is_group){
|
||||
->select()->each(function ($item) use($is_group,$export){
|
||||
$find = StoreProduct::where('id', $item['product_id'])->field('image,unit,cate_id,store_name,store_info')->find();
|
||||
$item['nickname']='';
|
||||
$item['mobile']='';
|
||||
$item['order_id']='';
|
||||
if($export>0){
|
||||
$item['order_id']=StoreOrder::where('id',$item['oid'])->value('order_id');
|
||||
}
|
||||
if ($find) {
|
||||
$item['image'] = $find['image']; //商品图片
|
||||
if($is_group==1){
|
||||
@ -162,6 +167,7 @@ class StoreOrderCartInfoTwoLists extends BaseAdminDataLists implements ListsSear
|
||||
];
|
||||
} else {
|
||||
$data = [
|
||||
'order_id' => '订单',
|
||||
'system_store' => '门店',
|
||||
'store_name' => '商品名称',
|
||||
'store_info' => '规格',
|
||||
|
Loading…
x
Reference in New Issue
Block a user