Merge pull request '用户重新发送短信' (#20) from mkm into master
Reviewed-on: http://git.excellentkk.cn/mkm/TaskSystem/pulls/20
This commit is contained in:
commit
d34cafd61c
@ -169,9 +169,9 @@ class UserController extends BaseApiController
|
|||||||
public function initiate_contract()
|
public function initiate_contract()
|
||||||
{
|
{
|
||||||
$params = $this->request->param();
|
$params = $this->request->param();
|
||||||
$admin_id=Db::name('user')->where('id',$this->userId)->value('admin_id');
|
$admin_id = Db::name('user')->where('id', $this->userId)->value('admin_id');
|
||||||
$result = CommonUserLogic::initiate_contract($params,$admin_id);
|
$result = CommonUserLogic::initiate_contract($params, $admin_id);
|
||||||
if($result==true){
|
if ($result == true) {
|
||||||
return $this->success('发起成功,等待平台风控部上传合同');
|
return $this->success('发起成功,等待平台风控部上传合同');
|
||||||
}
|
}
|
||||||
return $this->fail(CommonUserLogic::getError());
|
return $this->fail(CommonUserLogic::getError());
|
||||||
@ -181,9 +181,23 @@ class UserController extends BaseApiController
|
|||||||
{
|
{
|
||||||
$params = $this->request->param();
|
$params = $this->request->param();
|
||||||
$result = CommonUserLogic::Draftingcontracts($params);
|
$result = CommonUserLogic::Draftingcontracts($params);
|
||||||
if($result==true){
|
if ($result == true) {
|
||||||
return $this->success('生成合同成功');
|
return $this->success('生成合同成功');
|
||||||
}
|
}
|
||||||
return $this->fail(CommonUserLogic::getError());
|
return $this->fail(CommonUserLogic::getError());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//**发送短信 */
|
||||||
|
public function postsms()
|
||||||
|
{
|
||||||
|
$params = $this->request->param();
|
||||||
|
$params['mobile']=$this->userInfo['mobile'];
|
||||||
|
$params['nickname']=$this->userInfo['nickname'];
|
||||||
|
$res = CommonUserLogic::postsms($params);
|
||||||
|
if ($res == true) {
|
||||||
|
return $this->success('发送成功', [], 1, 1);
|
||||||
|
} else {
|
||||||
|
return $this->fail(CommonUserLogic::getError());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -54,7 +54,7 @@ class UserLogic extends BaseLogic
|
|||||||
// $user->sex = $user->getData('sex');
|
// $user->sex = $user->getData('sex');
|
||||||
$user['qualification'] = json_decode($user->qualification, true);
|
$user['qualification'] = json_decode($user->qualification, true);
|
||||||
// if ($user->is_contract == 1) {
|
// if ($user->is_contract == 1) {
|
||||||
$user['contract'] = Contract::where(['type' => 2, 'party_b' => $userId])->with(['partyA', 'contractType'])->find();
|
$user['contract'] = Contract::where(['type' => 2, 'party_b' => $userId])->with(['partyA', 'contractType'])->find();
|
||||||
// }
|
// }
|
||||||
return $user->toArray();
|
return $user->toArray();
|
||||||
}
|
}
|
||||||
@ -143,7 +143,7 @@ class UserLogic extends BaseLogic
|
|||||||
|
|
||||||
$result = self::detail($params['id']);
|
$result = self::detail($params['id']);
|
||||||
if ($result && $result['contract'] && $result['contract']['file'] != '') {
|
if ($result && $result['contract'] && $result['contract']['file'] != '') {
|
||||||
if($result['contract']['check_status']==3){
|
if ($result['contract']['check_status'] == 3) {
|
||||||
return self::setError('你已经生成过合同,请问重复生成');
|
return self::setError('你已经生成过合同,请问重复生成');
|
||||||
}
|
}
|
||||||
$data = [
|
$data = [
|
||||||
@ -153,7 +153,7 @@ class UserLogic extends BaseLogic
|
|||||||
];
|
];
|
||||||
$res = app(JunziqianController::class)->Signing($data, $result['contract']['id']);
|
$res = app(JunziqianController::class)->Signing($data, $result['contract']['id']);
|
||||||
if ($res->success == true) {
|
if ($res->success == true) {
|
||||||
Db::name('contract')->where('id', $result['contract']['id'])->update(['contract_no' => $res->data,'check_status'=>3]);
|
Db::name('contract')->where('id', $result['contract']['id'])->update(['contract_no' => $res->data, 'check_status' => 3]);
|
||||||
$data = array(
|
$data = array(
|
||||||
"applyNo" => $res->data, //TODO *
|
"applyNo" => $res->data, //TODO *
|
||||||
"fullName" => $result['nickname'], //TODO *
|
"fullName" => $result['nickname'], //TODO *
|
||||||
@ -187,4 +187,30 @@ class UserLogic extends BaseLogic
|
|||||||
return self::setError('生成合同成功失败,联系管理员');
|
return self::setError('生成合同成功失败,联系管理员');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//**发送短信 */
|
||||||
|
public static function postsms($params)
|
||||||
|
{
|
||||||
|
$find = Db::name('contract')->where('party_b', $params['id'])
|
||||||
|
->withAttr('contract_type_name', function ($value, $data) {
|
||||||
|
return Db::name('dict_data')->where('id', $data['contract_type'])->value('name');
|
||||||
|
})
|
||||||
|
->find();
|
||||||
|
if ($find) {
|
||||||
|
//发送短信
|
||||||
|
$sms = [
|
||||||
|
'mobile' => $params['mobile'],
|
||||||
|
'name' => $params['nickname'],
|
||||||
|
'type' => '《' . $find['contract_type_name'] . '》',
|
||||||
|
'code' => 'api/Hetong/url?id=' . $find['id'],
|
||||||
|
'scene' => 'WQ'
|
||||||
|
];
|
||||||
|
$result = SmsLogic::contractUrl($sms);
|
||||||
|
if (true === $result) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return self::setError(SmsLogic::getError());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user