diff --git a/Application/Admin/Controller/PartnerController.class.php b/Application/Admin/Controller/PartnerController.class.php index 99b0b5fc3..9c677d708 100644 --- a/Application/Admin/Controller/PartnerController.class.php +++ b/Application/Admin/Controller/PartnerController.class.php @@ -37,9 +37,10 @@ class PartnerController extends ThinkController $row = intval(I('row', 0)); $row = empty($row) ? 10 : $row;//每页条数 - $data = $model - ->field('tab_partner.id,tab_partner.partner,tab_partner.status,tab_partner.create_time,sys_member.nickname') - ->join('left join sys_member on sys_member.uid = tab_partner.uid') + $data = $model->alias('p') + ->field('p.id,p.partner,p.status,p.create_time,link_man,link_phone,address,company_tax_no,payee_name, + bank_account,opening_bank,m.nickname') + ->join('left join sys_member as m on m.uid = p.uid') ->where($map) ->order('id desc') ->page($page, $row) @@ -92,10 +93,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 +144,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 +157,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 +185,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')); } diff --git a/Application/Admin/View/Partner/add.html b/Application/Admin/View/Partner/add.html index c499967a0..d4efaf0cd 100644 --- a/Application/Admin/View/Partner/add.html +++ b/Application/Admin/View/Partner/add.html @@ -35,6 +35,57 @@ + +