新增推广员时,新增推广所属公司

master
liuweiwen 5 years ago
parent ea4b25065e
commit d51725f1af

@ -194,14 +194,27 @@ class PromoteController extends ThinkController
parent::lists('SiteApply', $p, $map);
}
public function add($account=null, $password=null, $second_pwd=null, $real_name=null, $email=null, $mobile_phone=null, $bank_name=null, $bank_card=null, $admin=null, $status=null, $ba_id = null)
public function add($account=null, $password=null, $second_pwd=null, $real_name=null, $email=null, $mobile_phone=null,
$bank_name=null, $bank_card=null, $admin=null, $status=null, $ba_id = null, $partner_id = null)
{
if (IS_POST) {
if (C('PROMOTE_AUTO_AUDIT') == 1) {
$status = 1;
}
$data = array('account'=>$account,'password'=>$password,'second_pwd'=>$second_pwd,'real_name'=>$real_name,'email'=>$email,'mobile_phone'=>$mobile_phone,'bank_name'=>$bank_name,'bank_card'=>$bank_card,'admin_id'=>$admin,'status'=>$status,'ba_id'=>$ba_id);
$data = array(
'account'=>$account,
'password'=>$password,
'second_pwd'=>$second_pwd,
'real_name'=>$real_name,
'email'=>$email,
'mobile_phone'=>$mobile_phone,
'bank_name'=>$bank_name,
'bank_card'=>$bank_card,
'admin_id'=>$admin,
'status'=>$status,
'ba_id'=>$ba_id,
'partner_id'=>$partner_id,
);
if (preg_match('/^[a-zA-Z0-9]{6,15}$/', $account)==false) {
$this->error('账号只能是6-15位字母或数字');
}
@ -215,11 +228,13 @@ class PromoteController extends ThinkController
} */
$this->success("添加成功", U('lists'));
} else {
$this->error($res);
$this->error('添加失败');
}
} else {
$this->meta_title ='新增渠道信息';
$this->m_title = '推广员列表';
$partners = M('partner', 'tab_')->where(['status' => 1])->select();
$this->assign('partners', $partners);
$this->assign('commonset', M('Kuaijieicon')->where(['url'=>'Promote/lists/type/1','status'=>1])->find());
$this->display();
}

@ -82,6 +82,20 @@
</td>
</tr>
<tr>
<td class="l">所属推广公司</td>
<td class="r">
<select name="partner_id" id="partner_id">
<option value="0">请选择推广公司</option>
<volist name="partners" id="vo">
<option value="{$vo.id}">{$vo.partner}</option>
</volist>
</select>
<!-- <span class="notice-text">设置该推广员所属的推广公司</span>-->
</td>
</tr>
</tbody>
</table>
</div>

@ -940,10 +940,11 @@ class PromoteService {
'mobile_phone' => $params['mobile_phone'],
'bank_name' => $params['bank_name'] ?? '',
'bank_card' => $params['bank_card'],
'status' => 1,
// 'status' => 1,
'parent_id' => $parent ? $parent['id'] : 0,
'parent_name' => $parent ? $parent['account'] : '官方渠道',
'admin_id' => $params['admin_id'] ?? 0,
'partner_id' => $params['partner_id'] ?? 0,
'invite_code' => $params['invite_code'] ?? '',
'create_time' => time(),
];

Loading…
Cancel
Save