|
@@ -3,6 +3,7 @@
|
|
|
namespace App\Service;
|
|
|
|
|
|
use App\Model\Construction;
|
|
|
+use App\Model\ConstructionInfo;
|
|
|
use App\Model\Customer;
|
|
|
use App\Model\CustomerInfo;
|
|
|
use App\Model\Employee;
|
|
@@ -97,6 +98,8 @@ class DeleteService extends Service
|
|
|
$this->fpSaleOrderMan($data,$user);
|
|
|
}elseif ($data['type'] == 2){
|
|
|
$this->fpCustomerMan($data,$user);
|
|
|
+ }elseif($data['type'] == 3){
|
|
|
+ $this->fpConstructionMan($data,$user);
|
|
|
}
|
|
|
|
|
|
DB::commit();
|
|
@@ -208,6 +211,36 @@ class DeleteService extends Service
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public function fpConstructionMan($data,$user){
|
|
|
+ $time = time();
|
|
|
+ if(! empty($data['man'])){
|
|
|
+ //负责人清除
|
|
|
+ ConstructionInfo::where('del_time',0)
|
|
|
+ ->whereIn('construction_id',$data['id'])
|
|
|
+ ->where('type', CustomerInfo::type_three)
|
|
|
+ ->update(['del_time' => $time]);
|
|
|
+
|
|
|
+ $insert = [];
|
|
|
+ foreach ($data['man'] as $value){
|
|
|
+ $insert[] = [
|
|
|
+ 'construction_id' => $data['id'],
|
|
|
+ 'employee_id' => $value,
|
|
|
+ 'type' => ConstructionInfo::type_three,
|
|
|
+ 'crt_time' => $time,
|
|
|
+ ];
|
|
|
+ }
|
|
|
+ ConstructionInfo::insert($insert);
|
|
|
+
|
|
|
+ $order = Construction::where('id',$data['id'])->first();
|
|
|
+ $order = $order->toArray();
|
|
|
+ (new OrderOperationService())->add([
|
|
|
+ 'order_number' => $order['order_number'],
|
|
|
+ 'msg' => OrderOperation::$type[OrderOperation::twenty_six] ?? "",
|
|
|
+ 'type' => OrderOperation::twenty_six
|
|
|
+ ],$user);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public function yj($data,$user){
|
|
|
if(empty($data['id']) || empty($data['type']) || empty($data['man'])) return [false, '必填参数不能为空!'];
|
|
|
|