|
@@ -103,6 +103,7 @@ class Customer extends Base
|
|
|
*/
|
|
|
public function admin_user_index()
|
|
|
{
|
|
|
+ Db::name('ranking')->where('status',0)->update(['status' => 1]);
|
|
|
if (request()->isAjax()) {
|
|
|
extract(input());
|
|
|
$map = [];
|
|
@@ -168,6 +169,7 @@ class Customer extends Base
|
|
|
$a_website[] = '<a href='.$vv.' target="_blank" style="color:#3BA1FF">'.$vv.'</a>';
|
|
|
}
|
|
|
$lists[$k]['a_website'] = implode('&&',$a_website);
|
|
|
+ $lists[$k]['admin_group'] = session('groupid');
|
|
|
unset($a_website);
|
|
|
}
|
|
|
return json(['code' => 220, 'msg' => '', 'count' => $count, 'data' => $lists]);
|
|
@@ -191,7 +193,6 @@ class Customer extends Base
|
|
|
->select();
|
|
|
$this->assign('type', $typrData);
|
|
|
$this->assign('admin', UserModel::where('groupid', '4')->select());
|
|
|
-
|
|
|
return $this->fetch('/customer/admin/admin_user_index');
|
|
|
}
|
|
|
|
|
@@ -605,6 +606,7 @@ class Customer extends Base
|
|
|
$a_website[] = '<a href='.$vv.' target="_blank" style="color:#3BA1FF">'.$vv.'</a>';
|
|
|
}
|
|
|
$lists[$k]['a_website'] = implode('&&',$a_website);
|
|
|
+ $lists[$k]['admin_group'] = session('groupid');
|
|
|
unset($a_website);
|
|
|
}
|
|
|
return json(['code' => 220, 'msg' => '', 'count' => $count, 'data' => $lists]);
|
|
@@ -703,6 +705,7 @@ class Customer extends Base
|
|
|
$a_website[] = '<a href='.$vv.' target="_blank" style="color:#3BA1FF">'.$vv.'</a>';
|
|
|
}
|
|
|
$lists[$k]['a_website'] = implode('&&',$a_website);
|
|
|
+ $lists[$k]['admin_group'] = session('groupid');
|
|
|
unset($a_website);
|
|
|
}
|
|
|
return json(['code' => 220, 'msg' => '', 'count' => $count, 'data' => $lists]);
|
|
@@ -814,6 +817,7 @@ class Customer extends Base
|
|
|
$a_website[] = '<a href='.$vv.' target="_blank" style="color:#3BA1FF">'.$vv.'</a>';
|
|
|
}
|
|
|
$lists[$k]['a_website'] = implode('&&',$a_website);
|
|
|
+ $lists[$k]['admin_group'] = session('groupid');
|
|
|
unset($a_website);
|
|
|
}
|
|
|
|
|
@@ -911,6 +915,7 @@ class Customer extends Base
|
|
|
$a_website[] = '<a href='.$vv.' target="_blank" style="color:#3BA1FF">'.$vv.'</a>';
|
|
|
}
|
|
|
$lists[$k]['a_website'] = implode('&&',$a_website);
|
|
|
+ $lists[$k]['admin_group'] = session('groupid');
|
|
|
unset($a_website);
|
|
|
}
|
|
|
return json(['code' => 220, 'msg' => '', 'count' => $count, 'data' => $lists]);
|
|
@@ -1967,4 +1972,29 @@ class Customer extends Base
|
|
|
}
|
|
|
return json(['code' => 200, 'msg' => '删除成功']);
|
|
|
}
|
|
|
+ /**
|
|
|
+ * 修改业务员
|
|
|
+ */
|
|
|
+ public function customerEdit()
|
|
|
+ {
|
|
|
+ if ($this->request->isPost()) {
|
|
|
+ $param = input('post.');
|
|
|
+ try {
|
|
|
+ Db::startTrans();
|
|
|
+ Db::name('customer')->where('id',$param['id'])->update(['spread_id'=>$param['aid']]);
|
|
|
+ Db::name('ranking')->where('c_id',$param['id'])->update(['admin_id' =>$param['aid']]);
|
|
|
+ Db::commit();
|
|
|
+ } catch (Exception $e) {
|
|
|
+ Db::rollback();
|
|
|
+ $this->error($e);
|
|
|
+ return json(['code' =>100 ,'msg' => '修改失败']);
|
|
|
+ }
|
|
|
+ return json(['code' => 200, 'msg' => '修改成功']);
|
|
|
+ }
|
|
|
+ $id = $this->request->param('id');
|
|
|
+ $admin = Db::name('admin')->where('groupid',4)->select();
|
|
|
+ $this->assign('admin',$admin);
|
|
|
+ $this->assign('id',$id);
|
|
|
+ return $this->fetch();
|
|
|
+ }
|
|
|
}
|