input('search'); $where = [['is_del',0]]; if(!empty($search)){ $where[] = ['name','like','%'.$search.'%']; } $list = Contract::where($where) ->select(['id','name','texts','sign_party']) ->paginate(10); return $this->apiResponseSuccess('获取列表成功', [ 'items' => $list->items(), 'total' => $list->total(), 'limit' => 10, ]); } /** * 获取机构列表 * @return \Illuminate\Http\JsonResponse */ function getFirmList(){ $search=request()->input('search'); $where = [['is_del',0], ['realnameStatus',1], ['authorizeUserInfo',1]]; if(!empty($search)){ $where[] = ['firm_name','like','%'.$search.'%']; } $list = Firm::where($where) ->select(['id','firm_name','license_number','legal_name','orgId','realnameStatus','authorizeUserInfo','created_at']) ->paginate(10); return $this->apiResponseSuccess('获取列表成功', [ 'items' => $list->items(), 'total' => $list->total(), 'limit' => 10, ]); } /** * 获取用户列表 * @return \Illuminate\Http\JsonResponse */ function getMemberList(){ $search=request()->input('search'); $where = [['is_del',0], ['realnameStatus',1], ['authorizeUserInfo',1]]; if(!empty($search)){ $where[] = ['name','like','%'.$search.'%']; } $list = Member::where($where) ->select(['id','name','phone','id_number','psnId','realnameStatus','authorizeUserInfo','created_at']) ->paginate(10); return $this->apiResponseSuccess('获取列表成功', [ 'items' => $list->items(), 'total' => $list->total(), 'limit' => 10, ]); } function createSignContract() { $contract_id=request()->input('contract_id');//合同id $contract_no=request()->input('contract_no');//合同编号 $text_json=request()->input('textsJson');//替换文本json $sign_json=request()->input('signJson');//签署区域信息 if(empty($contract_id)){ return $this->apiResponseError('请选择合同'); } if(empty($textsJson)){ return $this->apiResponseError('请填写合同信息'); } if(empty($signJson)){ return $this->apiResponseError('请选择签署信息'); } //获取合同信息 $contract = Contract::where(['id'=>$contract_id])->first(); if (empty($contract)){ return $this->apiResponseError('合同不存在'); } //替换合同信息 $file_path = $contract->{'contracts_file'}; // 获取所有信息 $pathInfo = pathinfo($file_path); $file_name = $pathInfo['filename'].$contract_no.'.'.$pathInfo['extension']; //替换合同信息 $local_file = WordServer::creatServer()->replaceWordText($file_path,$file_name,$textsJson); //上传文件到e签宝并获得文件id $file_id = ESignContractServer::creatServer()->fileUploadUrl($local_file); $data = compact('contract_id','contract_no','file_id','text_json','sign_json','local_file'); } }