dataLists(new ShopContractLists()); } /** * @notes 添加 * @return \think\response\Json * @author likeadmin * @date 2023/09/13 17:01 */ public function add() { $params = (new ShopContractValidate())->post()->goCheck('add'); $result = ShopContractLogic::add($params); if (true === $result) { return $this->success('添加成功', [], 1, 1); } return $this->fail(ShopContractLogic::getError()); } /** * @notes 编辑 * @return \think\response\Json * @author likeadmin * @date 2023/09/13 17:01 */ public function edit() { $params = (new ShopContractValidate())->post()->goCheck('edit'); $result = ShopContractLogic::edit($params); if (true === $result) { return $this->success('编辑成功', [], 1, 1); } return $this->fail(ShopContractLogic::getError()); } /** * @notes 删除 * @return \think\response\Json * @author likeadmin * @date 2023/09/13 17:01 */ public function delete() { $params = (new ShopContractValidate())->post()->goCheck('delete'); ShopContractLogic::delete($params); return $this->success('删除成功', [], 1, 1); } /** * @notes 获取详情 * @return \think\response\Json * @author likeadmin * @date 2023/09/13 17:01 */ public function detail() { $params = (new ShopContractValidate())->goCheck('detail'); $result = ShopContractLogic::detail($params); return $this->data($result); } // 上传合同 public function wind_control() { $params = $this->request->param(); $file = $params['file']; $res = ShopContract::where('id', $params['id'])->update(['file' => $file, 'check_status' => 2]); if ($res) { $find = ShopContract::where('id', $params['id'])->field('type,party_b,party_a') ->find()->toArray(); $find['party_a_info'] = ShopMerchant::where('id', $find['party_a'])->field('company_name name,master_phone phone')->find()->toArray(); $find['party_b_info'] = ShopMerchant::where('id', $find['party_b'])->field('company_name name,master_phone phone')->find()->toArray(); $a = [ 'mobile' => $find['party_a_info']['phone'], 'name' => $find['party_a_info']['name'], 'scene' => 'WQTZ' ]; SmsLogic::contractUrl($a); $b = [ 'mobile' => $find['party_b_info']['phone'], 'name' => $find['party_b_info']['name'], 'scene' => 'WQTZ' ]; SmsLogic::contractUrl($b); return $this->success('上传成功', [], 1, 1); } else { if ($res == 0) { return $this->success('没有更新', [], 1, 1); } return $this->fail('上传失败'); } } // 发送合同 public function Draftingcontracts() { $params = $this->request->param(); $result = ShopContractLogic::Draftingcontracts($params); if ($result == true) { return $this->success('生成合同成功', [], 1, 1); } return $this->fail(ContractLogic::getError()); } //**发送短信 */ 接口可能要做调整 public function postsms() { $params = $this->request->param(); $re = ShopContractLogic::postsms($params); if (!$re) { return $this->fail(ShopContractLogic::getError()); } return $this->success('成功'); } public function evidence() { $id = $this->request->param('id'); $detail=ShopContract::where('id',$id)->find(); if(!empty($detail['evidence_url'])){ return $this->success('获取成功', ['url' => env('url.url_prefix').$detail['evidence_url']]); } $company=ShopMerchant::where('id',$detail['party_a'])->find(); $request = array( "applyNo" => $detail['contract_no'], "fullName" => $company['company_name'], "identityCard" => $company['organization_code'], "identityType" => 12, ); return app(JunziqianController::class)->EvidenceShopDownload($request); } public function addNote() { $params = $this->request->param(); // id notes $shopContract = ShopContract::where('id', $params['id'])->find(); if (empty($shopContract)) { return $this->fail('合同不存在'); } $shopContract->notes = $params['notes']; $shopContract->save(); return $this->success('成功'); } }