diff --git a/app/api/controller/TaskController.php b/app/api/controller/TaskController.php index 4de420f35..3685446dc 100644 --- a/app/api/controller/TaskController.php +++ b/app/api/controller/TaskController.php @@ -13,6 +13,7 @@ use app\common\model\informationg\UserInformationg; use app\common\model\task\Task; use app\common\model\task_template\TaskTemplate; use app\common\model\user\User; +use app\common\model\vehicle\VehicleRent; use think\Exception; use think\facade\Db; @@ -223,9 +224,10 @@ class TaskController extends BaseApiController { $parmas = $this->request->param(); $task = Task::where('id', $parmas['id'])->find()->toArray(); - $object_id=CompanyProperty::where('company_id',$this->userInfo['company_id'])->value('object_id'); - if(!$object_id){ - return $this->fail('该公司没有三轮车,请先租赁三轮车'); + $VehicleRent = VehicleRent::where('rent_company_id',$params['company_id'])->find(); + if(empty($VehicleRent)){ + self::setError('该公司没有三轮车,请先租赁三轮车'); + return false; } $start_time = date('Y-m-d'); $time=strtotime($start_time)+86399;