data($result); } /** * @notes 全局配置 * @return Json * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author 段誉 * @date 2022/9/21 19:41 */ public function config() { $result = IndexLogic::getConfigData(); return $this->data($result); } /** * @notes 政策协议 * @return Json * @author 段誉 * @date 2022/9/20 20:00 */ public function policy() { $type = $this->request->get('type/s', ''); $result = IndexLogic::getPolicyByType($type); return $this->data($result); } /** * @notes 装修信息 * @return Json * @author 段誉 * @date 2022/9/21 18:37 */ public function decorate() { $id = $this->request->get('id/d'); $result = IndexLogic::getDecorate($id); return $this->data($result); } public function notifyUrl() { $params = Request()->get(['id']); if(empty($params['id'])){ return json(['success' => false, 'msg' => '缺少参数']); } //获取合同数据 $contract = Contract::where('id',$params['id'])->find(); if(!$contract || $contract->isEmpty()){ return json(['success' => false, 'msg' => '参数错误']); } $carIds = implode(',',array_column(json_decode($contract['cars_info']),'id')); if ($contract['signing_timer'] == 0) { Contract::where('id',$params['id'])->update(['signing_timer'=>1]); curl_post('https://worker-task.lihaink.cn/api/index/notifyVehicleContractUpdate',[],[ 'contract_logistic_id' => $contract['id'], 'signing_timer' => 1, ]); }else if($contract['signing_timer'] == 1) { Contract::where('id',$params['id'])->update(['signing_timer'=>2,'status'=>3]); Vehicle::where('id','in',$carIds)->update(['status'=>3]); curl_post('https://worker-task.lihaink.cn/api/index/notifyVehicleContractUpdate',[],[ 'contract_logistic_id' => $contract['id'], 'signing_timer' => 2, 'status' => 3 ]); curl_post('https://worker-task.lihaink.cn/v1/notify_property',[],[ 'company_id' => $contract['company_b_id'], 'object_id' => $carIds ]); } return json(['success' => true, 'msg' => '成功']); } }