更新
This commit is contained in:
parent
445f715559
commit
c4beb5d385
@ -191,7 +191,8 @@ class CompanyController extends BaseApiController
|
|||||||
/**
|
/**
|
||||||
* 股金管理
|
* 股金管理
|
||||||
*/
|
*/
|
||||||
public function shareholder_info(){
|
public function shareholder_info()
|
||||||
|
{
|
||||||
// $params = $this->request->param();
|
// $params = $this->request->param();
|
||||||
$find = Company::where('id', $this->userInfo['company_id'])->field('shareholder_money,village')->find()->toArray();
|
$find = Company::where('id', $this->userInfo['company_id'])->field('shareholder_money,village')->find()->toArray();
|
||||||
$find['is_contract'] = 0;
|
$find['is_contract'] = 0;
|
||||||
@ -216,14 +217,36 @@ class CompanyController extends BaseApiController
|
|||||||
$find['contract_url'] = '';
|
$find['contract_url'] = '';
|
||||||
$find['contract_time'] = '';
|
$find['contract_time'] = '';
|
||||||
$find['is_amount_turned'] = 0;
|
$find['is_amount_turned'] = 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
return $this->success('ok', $find);
|
return $this->success('ok', $find);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function pay_share_capital(){
|
//**发起股金合同 */
|
||||||
|
public function initiate_shareholder_contract()
|
||||||
|
{
|
||||||
|
$params = $this->request->param();
|
||||||
|
$params['party_b'] = $this->userInfo['company_id'];
|
||||||
|
if(!$params['party_b']){
|
||||||
|
return $this->fail('请先绑定公司');
|
||||||
|
}
|
||||||
|
$Company = Company::where('id', $this->userInfo['company_id'])->field('shareholder_money,village')->find();
|
||||||
|
if($Company){
|
||||||
|
$params['party_a'] = Company::where('village', $Company['village'])->where('company_type', 17)->value('id');
|
||||||
|
}
|
||||||
|
if(!isset($params['party_a'])||$params['party_a']==0){
|
||||||
|
return $this->fail('甲方公司不存在');
|
||||||
|
}
|
||||||
|
$area_manager = Company::where('id', $params['party_b'])->value('area_manager');
|
||||||
|
$params['area_manager'] = $area_manager;
|
||||||
|
$params['type'] = 1;
|
||||||
|
$result = ContractLogic::initiate_contract($params);
|
||||||
|
if ($result == true) {
|
||||||
|
return $this->success('发起成功,等待平台风控部上传合同');
|
||||||
|
}
|
||||||
|
return $this->fail(ContractLogic::getError());
|
||||||
|
}
|
||||||
|
public function pay_share_capital()
|
||||||
|
{
|
||||||
// return
|
// return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -183,7 +183,7 @@ class ContractLogic extends BaseLogic
|
|||||||
//生成合同
|
//生成合同
|
||||||
public static function Initiate_contract($data)
|
public static function Initiate_contract($data)
|
||||||
{
|
{
|
||||||
$model = Contract::where(['party_b' => $data['party_b']])->find();
|
$model = Contract::where(['party_b' => $data['party_b'],'contract_type'=>$data['contract_type']])->find();
|
||||||
if (empty($model)) {
|
if (empty($model)) {
|
||||||
$model = new Contract();
|
$model = new Contract();
|
||||||
$model->contract_no = time();
|
$model->contract_no = time();
|
||||||
@ -205,15 +205,6 @@ class ContractLogic extends BaseLogic
|
|||||||
$model->update_time = time();
|
$model->update_time = time();
|
||||||
$model->setAttrs($data);
|
$model->setAttrs($data);
|
||||||
$res = $model->save($data);
|
$res = $model->save($data);
|
||||||
//如果是租赁合同,调用接口通知物流系统
|
|
||||||
// if($data['contract_type'] == 29){
|
|
||||||
// curl_post('http://logistics.lihaink.cn/api/setContract',[],[
|
|
||||||
// 'party_a' => $data['party_a'],
|
|
||||||
// 'party_b' => $data['party_b'],
|
|
||||||
// 'num' => $data['num'],
|
|
||||||
// 'rent_type' => 1
|
|
||||||
// ]);
|
|
||||||
// }
|
|
||||||
if($res){
|
if($res){
|
||||||
return ['code'=>1,'msg'=>'发起成功,等待平台风控部上传合同','data'=>['id'=>$model->id]];
|
return ['code'=>1,'msg'=>'发起成功,等待平台风控部上传合同','data'=>['id'=>$model->id]];
|
||||||
}else{
|
}else{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user