|
@@ -3,6 +3,7 @@
|
|
|
namespace App\Service;
|
|
|
|
|
|
use App\Model\BasicType;
|
|
|
+use App\Model\Construction;
|
|
|
use App\Model\Employee;
|
|
|
use App\Model\Product;
|
|
|
use App\Model\ProductActivity;
|
|
@@ -111,6 +112,10 @@ class ScheduleService extends Service
|
|
|
public function del($data){
|
|
|
if($this->isEmpty($data,'id')) return [false,'请选择数据!'];
|
|
|
|
|
|
+ $boolean = Construction::where('del_time',0)
|
|
|
+ ->where('schedule_id',$data['id'])
|
|
|
+ ->exists();
|
|
|
+ if($boolean) return [false,'施工单已使用排期,操作失败!'];
|
|
|
try {
|
|
|
DB::beginTransaction();
|
|
|
|
|
@@ -195,6 +200,11 @@ class ScheduleService extends Service
|
|
|
->where('start_time', '<=', $data['end_time'])
|
|
|
->where('end_time', '>=', $data['start_time'])
|
|
|
->exists();
|
|
|
+
|
|
|
+ $boolean = Construction::where('del_time',0)
|
|
|
+ ->where('schedule_id',$data['id'])
|
|
|
+ ->exists();
|
|
|
+ if($boolean) return [false,'施工单已使用排期,编辑失败!'];
|
|
|
}
|
|
|
if($bool) return [false,'排班日期已经设置,请不要重复设置!'];
|
|
|
|