diff --git a/app/adminapi/controller/CompanyController.php b/app/adminapi/controller/CompanyController.php index 7c2f5bb80..765a29d07 100644 --- a/app/adminapi/controller/CompanyController.php +++ b/app/adminapi/controller/CompanyController.php @@ -24,6 +24,7 @@ use app\common\model\auth\Admin; use app\common\model\Company; use think\facade\Db; use app\common\logic\contract\ContractLogic; +use app\common\model\contract\Contract; /** * Company控制器 @@ -138,7 +139,8 @@ class CompanyController extends BaseAdminController public function postsms() { $params = (new CompanyValidate())->goCheck('detail'); - $res = ContractLogic::postsms($params); + $id=Contract::where('party_b', $params['id'])->value('id'); + $res = ContractLogic::postsms(['id'=>$id]); if ($res == true) { return $this->success('发送成功', [], 1, 1); } else { diff --git a/app/api/controller/CompanyController.php b/app/api/controller/CompanyController.php index 9c8fcd333..d1b180ade 100644 --- a/app/api/controller/CompanyController.php +++ b/app/api/controller/CompanyController.php @@ -168,7 +168,8 @@ class CompanyController extends BaseApiController public function postsms() { $params = $this->request->param(); - $res = ContractLogic::postsms($params); + $id=Contract::where('party_b', $params['id'])->value('id'); + $res = ContractLogic::postsms(['id'=>$id]); if ($res == true) { return $this->success('发送成功', [], 1, 1); } else { diff --git a/app/api/controller/UserController.php b/app/api/controller/UserController.php index 0e63c58f0..a27d1fa65 100755 --- a/app/api/controller/UserController.php +++ b/app/api/controller/UserController.php @@ -20,6 +20,7 @@ use app\api\validate\PasswordValidate; use app\api\validate\SetUserInfoValidate; use app\api\validate\UserValidate; use app\common\logic\contract\ContractLogic; +use app\common\model\contract\Contract; use Common; use think\facade\Db; @@ -199,7 +200,8 @@ class UserController extends BaseApiController public function postsms() { $params = $this->request->param(); - $res = ContractLogic::postsms($params); + $id=Contract::where('party_b', $params['id'])->value('id'); + $res = ContractLogic::postsms(['id'=>$id]); if ($res == true) { return $this->success('发送成功', [], 1, 1); } else { diff --git a/app/common/logic/contract/ContractLogic.php b/app/common/logic/contract/ContractLogic.php index 8facedfcc..74043fa97 100644 --- a/app/common/logic/contract/ContractLogic.php +++ b/app/common/logic/contract/ContractLogic.php @@ -179,17 +179,15 @@ class ContractLogic extends BaseLogic // /**发送合同 */ public static function Draftingcontracts($params,$type=1) { - self::postsms(['id'=>158]); - return true; if($type==1){ $result = CompanyLogic::detail($params); }else{ $result = UserLogic::detail($params['id']); } if ($result && isset($result['contract']) && isset($result['contract']['file']) && $result['contract']['file'] != '') { - // if ($result['contract']['check_status'] == 3) { - // return self::setError('你已经生成过合同,请问重复生成'); - // } + if ($result['contract']['check_status'] == 3) { + return self::setError('你已经生成过合同,请问重复生成'); + } if($type==1){ $name=$result['company_name']; $data = [