|
|
|
@ -92,10 +92,22 @@ class PartnerController extends ThinkController
|
|
|
|
|
if ($res) {
|
|
|
|
|
$this->error('合作方已存在');
|
|
|
|
|
}
|
|
|
|
|
if(!preg_match("/^1[358][0-9]{9}$/u",I('link_phone'))) {
|
|
|
|
|
$this->error('联系电话格式不正确');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$time = time();
|
|
|
|
|
$save['partner'] = $partner;
|
|
|
|
|
$save['status'] = $status;
|
|
|
|
|
|
|
|
|
|
$save['link_man'] = I('link_man');
|
|
|
|
|
$save['link_phone'] = I('link_phone');
|
|
|
|
|
$save['address'] = I('address');
|
|
|
|
|
$save['company_tax_no'] = I('company_tax_no');
|
|
|
|
|
$save['payee_name'] = I('payee_name');
|
|
|
|
|
$save['bank_account'] = I('bank_account');
|
|
|
|
|
$save['opening_bank'] = I('opening_bank');
|
|
|
|
|
|
|
|
|
|
$save['uid'] = UID;
|
|
|
|
|
$save['create_time'] = $time;
|
|
|
|
|
$save['last_up_time'] = $time;
|
|
|
|
@ -131,7 +143,9 @@ class PartnerController extends ThinkController
|
|
|
|
|
$this->error('参数异常');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$data = $model->field('id,partner')->find($id);
|
|
|
|
|
$data = $model
|
|
|
|
|
->field('id,partner,link_man,link_phone,address,company_tax_no,payee_name,bank_account,opening_bank')
|
|
|
|
|
->find($id);
|
|
|
|
|
if (empty($data)) {
|
|
|
|
|
$this->error('数据异常');
|
|
|
|
|
}
|
|
|
|
@ -142,12 +156,24 @@ class PartnerController extends ThinkController
|
|
|
|
|
$this->error('合作方已存在');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(!preg_match("/^1[358][0-9]{9}$/u",I('link_phone'))) {
|
|
|
|
|
$this->error('联系电话格式不正确');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$time = time();
|
|
|
|
|
$save['id'] = $id;
|
|
|
|
|
$save['partner'] = $partner;
|
|
|
|
|
|
|
|
|
|
$save['link_man'] = I('link_man');
|
|
|
|
|
$save['link_phone'] = I('link_phone');
|
|
|
|
|
$save['address'] = I('address');
|
|
|
|
|
$save['company_tax_no'] = I('company_tax_no');
|
|
|
|
|
$save['payee_name'] = I('payee_name');
|
|
|
|
|
$save['bank_account'] = I('bank_account');
|
|
|
|
|
$save['opening_bank'] = I('opening_bank');
|
|
|
|
|
|
|
|
|
|
$save['status'] = $status;
|
|
|
|
|
$save['last_up_time'] = $time;
|
|
|
|
|
|
|
|
|
|
$res = $model->save($save);
|
|
|
|
|
if ($res === false) {
|
|
|
|
|
$this->error('保存失败');
|
|
|
|
@ -158,7 +184,9 @@ class PartnerController extends ThinkController
|
|
|
|
|
} else {
|
|
|
|
|
$id = intval(I('get.id', 0));
|
|
|
|
|
$map['id'] = $id;
|
|
|
|
|
$data = $model->field('id,partner,status')->find($id);
|
|
|
|
|
$data = $model
|
|
|
|
|
->field('id,partner,status,link_man,link_phone,address,company_tax_no,payee_name,bank_account,opening_bank')
|
|
|
|
|
->find($id);
|
|
|
|
|
if (empty($data)) {
|
|
|
|
|
$this->error('数据异常', U('lists'));
|
|
|
|
|
}
|
|
|
|
|