|
|
|
@ -776,6 +776,12 @@ class ToolController extends ThinkController {
|
|
|
|
|
if (!in_array($status, [0, 1])) {
|
|
|
|
|
$this->error('参数异常');
|
|
|
|
|
}
|
|
|
|
|
if (!empty(I('fax_ratio'))) {
|
|
|
|
|
if(!preg_match('/^[0-9]+(.[0-9]{1,3})?$/', I('fax_ratio'))){
|
|
|
|
|
$this->error('税率只能数字');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$model = M('company_info', 'tab_');
|
|
|
|
|
$map['partner'] = $partner;
|
|
|
|
@ -802,6 +808,8 @@ class ToolController extends ThinkController {
|
|
|
|
|
$save['payee_name'] = I('payee_name');
|
|
|
|
|
$save['bank_account'] = I('bank_account');
|
|
|
|
|
$save['opening_bank'] = I('opening_bank');
|
|
|
|
|
$save['fax_ratio'] = I('fax_ratio');
|
|
|
|
|
$save['ali_account'] = I('ali_account');
|
|
|
|
|
|
|
|
|
|
$save['uid'] = UID;
|
|
|
|
|
$save['create_time'] = $time;
|
|
|
|
@ -842,6 +850,11 @@ class ToolController extends ThinkController {
|
|
|
|
|
if (!in_array($status, [0, 1])) {
|
|
|
|
|
$this->error('参数异常');
|
|
|
|
|
}
|
|
|
|
|
if (!empty(I('fax_ratio'))) {
|
|
|
|
|
if(!preg_match('/^[0-9]+(.[0-9]{1,3})?$/', I('fax_ratio'))){
|
|
|
|
|
$this->error('税率只能数字');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$data = $model
|
|
|
|
|
->field('id,partner,link_man,link_phone,address,company_tax_no,payee_name,bank_account,opening_bank')
|
|
|
|
@ -859,14 +872,14 @@ class ToolController extends ThinkController {
|
|
|
|
|
if(!checkPhone(I('link_phone'))) {
|
|
|
|
|
$this->error('联系电话格式不正确');
|
|
|
|
|
}
|
|
|
|
|
$res2 = $model->where([
|
|
|
|
|
'link_phone' => I('link_phone'),
|
|
|
|
|
'id' => ['neq', $id]
|
|
|
|
|
])->getField('id');
|
|
|
|
|
// $res2 = $model->where([
|
|
|
|
|
// 'link_phone' => I('link_phone'),
|
|
|
|
|
// 'id' => ['neq', $id]
|
|
|
|
|
// ])->getField('id');
|
|
|
|
|
|
|
|
|
|
if ($res2) {
|
|
|
|
|
$this->error('已存在此联系电话');
|
|
|
|
|
}
|
|
|
|
|
// if ($res2) {
|
|
|
|
|
// $this->error('已存在此联系电话');
|
|
|
|
|
// }
|
|
|
|
|
$time = time();
|
|
|
|
|
$save['id'] = $id;
|
|
|
|
|
$save['partner'] = $partner;
|
|
|
|
@ -879,6 +892,9 @@ class ToolController extends ThinkController {
|
|
|
|
|
$save['bank_account'] = I('bank_account');
|
|
|
|
|
$save['opening_bank'] = I('opening_bank');
|
|
|
|
|
|
|
|
|
|
$save['fax_ratio'] = I('fax_ratio');
|
|
|
|
|
$save['ali_account'] = I('ali_account');
|
|
|
|
|
|
|
|
|
|
$save['status'] = $status;
|
|
|
|
|
$save['last_up_time'] = $time;
|
|
|
|
|
$res = $model->save($save);
|
|
|
|
@ -892,7 +908,7 @@ class ToolController extends ThinkController {
|
|
|
|
|
$id = intval(I('get.id', 0));
|
|
|
|
|
$map['id'] = $id;
|
|
|
|
|
$data = $model
|
|
|
|
|
->field('id,partner,status,link_man,link_phone,address,company_tax_no,payee_name,bank_account,opening_bank')
|
|
|
|
|
->field('*')
|
|
|
|
|
->find($id);
|
|
|
|
|
if (empty($data)) {
|
|
|
|
|
$this->error('数据异常', U('company_info'));
|
|
|
|
|