diff --git a/app/admin/lists/beforehand_order_cart_info/BeforehandOrderCartInfoLists.php b/app/admin/lists/beforehand_order_cart_info/BeforehandOrderCartInfoLists.php index 9194087e..2a3c2497 100644 --- a/app/admin/lists/beforehand_order_cart_info/BeforehandOrderCartInfoLists.php +++ b/app/admin/lists/beforehand_order_cart_info/BeforehandOrderCartInfoLists.php @@ -71,7 +71,7 @@ class BeforehandOrderCartInfoLists extends BaseAdminDataLists implements ListsSe } $list = BeforehandOrderCartInfo::where($this->searchWhere) - ->field(['id', 'bhoid','package','store_info','marques','gross_weight','net_weight','accept_num','after_sales','loss', 'uid', 'is_buyer', 'buyer_uid', 'product_id', 'attr_value_id', 'purchase', 'price', 'total_price', 'cart_num', 'mark']) + ->field(['id', 'bhoid','package','store_info','marques','gross_weight','net_weight','accept_num','after_sales','loss', 'uid','pay_price', 'is_buyer', 'buyer_uid', 'product_id', 'attr_value_id', 'purchase', 'price', 'total_price', 'cart_num', 'mark']) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) ->select()->each(function ($item) use($system_store,$order_mark) { diff --git a/app/admin/lists/store_order_cart_info/StoreOrderCartInfoGroupLists.php b/app/admin/lists/store_order_cart_info/StoreOrderCartInfoGroupLists.php index 20d36225..b583d1fd 100644 --- a/app/admin/lists/store_order_cart_info/StoreOrderCartInfoGroupLists.php +++ b/app/admin/lists/store_order_cart_info/StoreOrderCartInfoGroupLists.php @@ -58,7 +58,7 @@ class StoreOrderCartInfoGroupLists extends BaseAdminDataLists implements ListsSe ->field('product_id,price,SUM(total_price) as total_price,SUM(cart_num) as cart_num')->group('product_id') ->limit($this->limitOffset, $this->limitLength) ->select()->each(function ($item) { - $find=StoreProduct::where('id',$item['product_id'])->field('image,unit,cate_id,store_name,store_info')->find(); + $find=StoreProduct::where('id',$item['product_id'])->field('image,unit,cate_id,store_name,store_info')->withTrashed()->find(); if($find){ $item['image']=$find['image'];//商品图片 $item['store_name']=$find['store_name'];//商品名称 diff --git a/app/admin/lists/store_order_cart_info/StoreOrderCartInfoGroupMonthLists.php b/app/admin/lists/store_order_cart_info/StoreOrderCartInfoGroupMonthLists.php index f4398fd6..0d00c539 100644 --- a/app/admin/lists/store_order_cart_info/StoreOrderCartInfoGroupMonthLists.php +++ b/app/admin/lists/store_order_cart_info/StoreOrderCartInfoGroupMonthLists.php @@ -59,7 +59,7 @@ class StoreOrderCartInfoGroupMonthLists extends BaseAdminDataLists implements Li ->order('cart_num desc') ->limit($this->limitOffset, $this->limitLength) ->select()->each(function ($item) { - $find=StoreProduct::where('id',$item['product_id'])->field('image,unit,cate_id,store_name,store_info')->find(); + $find=StoreProduct::where('id',$item['product_id'])->field('image,unit,cate_id,store_name,store_info')->withTrashed()->find(); if($find){ $item['image']=$find['image'];//商品图片 $item['store_name']=$find['store_name'];//商品名称 diff --git a/app/admin/lists/store_order_cart_info/StoreOrderCartInfoTwoLists.php b/app/admin/lists/store_order_cart_info/StoreOrderCartInfoTwoLists.php index b07e8d8c..12aaad7e 100644 --- a/app/admin/lists/store_order_cart_info/StoreOrderCartInfoTwoLists.php +++ b/app/admin/lists/store_order_cart_info/StoreOrderCartInfoTwoLists.php @@ -76,7 +76,7 @@ class StoreOrderCartInfoTwoLists extends BaseAdminDataLists implements ListsSear } return $query->limit($this->limitOffset, $this->limitLength) ->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(); + $find = StoreProduct::where('id', $item['product_id'])->field('image,unit,cate_id,store_name,store_info')->withTrashed()->find(); $item['nickname']=''; $item['mobile']=''; $item['order_id']=''; diff --git a/app/admin/logic/beforehand_order/BeforehandOrderLogic.php b/app/admin/logic/beforehand_order/BeforehandOrderLogic.php index 2ea01e68..0cc2cfe7 100644 --- a/app/admin/logic/beforehand_order/BeforehandOrderLogic.php +++ b/app/admin/logic/beforehand_order/BeforehandOrderLogic.php @@ -10,6 +10,7 @@ use app\common\model\beforehand_order\BeforehandOrder; use app\common\logic\BaseLogic; use app\common\model\auth\Admin; use app\common\model\beforehand_order_cart_info\BeforehandOrderCartInfo; +use app\common\model\beforehand_order_record\BeforehandOrderRecord; use app\common\model\purchase_product_offer\PurchaseProductOffer; use app\common\model\store_branch_product\StoreBranchProduct; use app\common\model\store_category\StoreCategory; @@ -105,6 +106,8 @@ class BeforehandOrderLogic extends BaseLogic 'order_type' => $order_type, 'other_data' => json_encode($params['other_data'], true) ]); + /** 添加审批记录 */ + BeforehandOrderRecord::create(['oid'=>$order['id'],'step_id'=>1]); $product_arr = []; foreach ($datas as $k => $v) { $datas[$k]['bhoid'] = $order['id']; @@ -515,6 +518,16 @@ class BeforehandOrderLogic extends BaseLogic $res['top_cate'] = $arr?->toArray(); } $res['system_store'] = SystemStore::where('id', $res['store_id'])->value('name'); + $res['admin_name'] = Admin::where('id', $res['admin_id'])->value('name'); + $record=BeforehandOrderRecord::where('oid',$params['id'])->order('id','desc')->find(); + $res['step_id']=1; + if($record){ + $res['step_id']=$record['step_id']; + if($record['check_user_id']>0){ + $res['examine_name']=Admin::where('id',$record['check_user_id'])->value('name'); + } + + } return $res; } diff --git a/app/admin/logic/user/UserLogic.php b/app/admin/logic/user/UserLogic.php index c97608d8..2dc843dc 100644 --- a/app/admin/logic/user/UserLogic.php +++ b/app/admin/logic/user/UserLogic.php @@ -247,7 +247,7 @@ class UserLogic extends BaseLogic $find->save(); } else { $capitalFlowDao->userExpense('system_purchase_dec', 'system', 0, $params['purchase_funds'],$params['mark']??''); - $find->purchase_funds = bcsub($params['purchase_funds'], $find['purchase_funds'], 2); + $find->purchase_funds = bcsub($find['purchase_funds'],$params['purchase_funds'], 2); $find->save(); } Db::commit(); @@ -272,7 +272,7 @@ class UserLogic extends BaseLogic $find->save(); } else { $capitalFlowDao->userExpense('system_balance_reduce', 'system', 0, $params['now_money'],$params['mark']??''); - $find->now_money = bcsub($params['now_money'], $find['now_money'], 2); + $find->now_money = bcsub($find['now_money'],$params['now_money'], 2); $find->save(); } Db::commit(); diff --git a/app/api/view/beforehand_order/record.html b/app/api/view/beforehand_order/record.html new file mode 100644 index 00000000..0a669bc3 --- /dev/null +++ b/app/api/view/beforehand_order/record.html @@ -0,0 +1,97 @@ + + + + + webman + + + + +
+ +
确认审批
+
下载表格
+ +
+ + + + \ No newline at end of file diff --git a/app/common/model/beforehand_order_record/BeforehandOrderRecord.php b/app/common/model/beforehand_order_record/BeforehandOrderRecord.php new file mode 100644 index 00000000..c2fc83f0 --- /dev/null +++ b/app/common/model/beforehand_order_record/BeforehandOrderRecord.php @@ -0,0 +1,22 @@ +setCellValue('A' . ($count + 5),'累计接单:'); $sheet->setCellValue('C' . ($count + 5),'预收金额:'); - $sheet->setCellValue('D' . ($count + 5),$order['pay_price']==0?$order['total_price']:$order['pay_price']); + $sheet->setCellValue('D' . ($count + 5),$order['total_price']); $sheet->setCellValue('E' . ($count + 5),'预收押金:'); $sheet->setCellValue('G' . ($count + 5),'合计预收:'); - $sheet->setCellValue('H' . ($count + 5),$order['pay_price']==0?$order['total_price']:$order['pay_price']); + $sheet->setCellValue('H' . ($count + 5),$order['total_price']); $sheet->setCellValue('A' . ($count + 6),'出库合计:'); $sheet->setCellValue('C' . ($count + 6),'出库金额:');