beforeOrder($event); break; case 2: $data=$this->afterOrder($event); break; case 3: case 4: break; } if(empty($data)==false)\app\admin\model\ThStock::create($data); } //售后退货 供应商不同意退货 protected function afterOrder($event){ $model =new OrderReturn(); $info =$model->where(["returnCode"=>$event['thCode']])->findOrEmpty(); if($info->isEmpty())return[]; if($info->status==5 && $info->return_tag==2){ $data=[ "thCode"=>$info->returnCode, "th_type"=>2, "order_type"=>$info->order_type, "supplierNo"=>$info->supplierNo, "supplierName"=>$info->supplierName, "companyNo"=>$info->companyNo, "companyName"=>$info->companyName, "customerNo"=>$info->customer_code, "customerName"=>$info->customer_name, "th_num"=>$info->error_num, "th_cgd_price"=>$event['sale_price'], "th_sale_price"=>$event['cgd_price'], "good_code"=>$info->good_code, "good_name"=>$info->good_name, "orderCode"=>$info->orderCode, 'cgdCode'=>$event['cgdNo'], "apply_id"=>$info->apply_id, "apply_name"=>$info->apply_name, ]; }else $data=[]; return $data; } //售前退货 供应商不同意退货 protected function beforeOrder($event){ $model =new SaleReturn(); $info =$model->where(['returnCode'=>$event['thCode']])->findOrEmpty(); if($info->isEmpty())return[]; if($info->status==4 && $info->is_th==0){ $data=[ 'thCode'=>$info->returnCode, 'th_type'=>1, 'order_type'=>$info->order_type, 'supplierNo'=>$info->supplierNo, 'supplierName'=>$info->supplierName, 'companyNo'=>$info->companyNo, 'companyName'=>$info->companyName, 'customerNo'=>$info->customer_code, 'customerName'=>$info->customer_name, 'th_num'=>$info->num, 'th_cgd_price'=>$event['sale_price'], 'th_sale_price'=>$event['cgd_price'], 'good_code'=>$info->good_code, 'good_name'=>$info->good_name, 'orderCode'=>$info->orderCode, 'cgdCode'=>$event['cgdNo'], 'apply_id'=>$info->apply_id, 'apply_name'=>$info->apply_name, ]; }else $data=[]; return $data; } }