This commit is contained in:
mkm 2024-01-21 15:13:10 +08:00
parent d5a52df439
commit 16ee8284db

View File

@ -136,27 +136,11 @@ class StoreOrderBehalf extends BaseController
$id = $this->request->param('id');
$uid = Db::name('merchant')->where('mer_id', $mer_id)->value('uid');
$res = Db::name('store_order_other')->where('uid', $uid)->where('order_id', $id)->update(['status' => $status]);
$find = Db::name('store_order_other')->where('uid', $uid)->where('order_id', $id)->find();
$find_two = Db::name('store_order')->where('order_sn', $find['order_sn'])->find();
// $find = Db::name('store_order_other')->where('uid', $uid)->where('order_id', $id)->find();
// $find_two = Db::name('store_order')->where('order_sn', $find['order_sn'])->find();
if($res){
if($status==3){
//进入市级供应链待分润状态
$financialRecordRepository = app()->make(FinancialRecordRepository::class);
$financeSn = $financialRecordRepository->getSn();
//市级供应链获得
$finance[] = [
'order_id' =>$find_two['order_id'],
'order_sn' => $find_two['order_id'],
'user_info' => $find['real_name'],
'user_id' => $uid,
'financial_type' => 'supply_chain',
'financial_pm' =>1,
'type' => 0,
'number' => $find['procure_price'],
'mer_id' => $find['mer_id'],
'financial_record_sn' => $financeSn.'1'
];
$financialRecordRepository->insertAll($finance);
}
return app('json')->success('设置成功');