|
|
|
@ -142,7 +142,7 @@ class User extends BaseController |
|
|
|
|
$data['pwd'] = $this->repository->encodePassword($data['repwd']); |
|
|
|
|
unset($data['repwd']); |
|
|
|
|
if ($data['is_promoter']) $data['promoter_time'] = date('Y-m-d H:i:s'); |
|
|
|
|
$this->repository->create('h5',$data); |
|
|
|
|
$this->repository->create('h5', $data); |
|
|
|
|
|
|
|
|
|
return app('json')->success('添加成功'); |
|
|
|
|
} |
|
|
|
@ -164,7 +164,7 @@ class User extends BaseController |
|
|
|
|
return app('json')->fail('密码不一致'); |
|
|
|
|
$data['pwd'] = $this->repository->encodePassword($data['repwd']); |
|
|
|
|
unset($data['repwd']); |
|
|
|
|
$this->repository->update($id,$data); |
|
|
|
|
$this->repository->update($id, $data); |
|
|
|
|
|
|
|
|
|
return app('json')->success('修改成功'); |
|
|
|
|
} |
|
|
|
@ -219,7 +219,7 @@ class User extends BaseController |
|
|
|
|
$data['label_id'] = implode(',', $label_id); |
|
|
|
|
if ($data['is_promoter']) |
|
|
|
|
$data['promoter_time'] = date('Y-m-d H:i:s'); |
|
|
|
|
if(!$data['birthday']) unset($data['birthday']); |
|
|
|
|
if (!$data['birthday']) unset($data['birthday']); |
|
|
|
|
|
|
|
|
|
$this->repository->update($id, $data); |
|
|
|
|
|
|
|
|
@ -562,7 +562,7 @@ class User extends BaseController |
|
|
|
|
|
|
|
|
|
public function memberForm($id) |
|
|
|
|
{ |
|
|
|
|
return app('json')->success(formToData($this->repository->memberForm($id,1))); |
|
|
|
|
return app('json')->success(formToData($this->repository->memberForm($id, 1))); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function memberSave($id) |
|
|
|
@ -576,7 +576,7 @@ class User extends BaseController |
|
|
|
|
|
|
|
|
|
public function spreadLevelForm($id) |
|
|
|
|
{ |
|
|
|
|
return app('json')->success(formToData($this->repository->memberForm($id,0))); |
|
|
|
|
return app('json')->success(formToData($this->repository->memberForm($id, 0))); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function spreadLevelSave($id) |
|
|
|
@ -595,8 +595,8 @@ class User extends BaseController |
|
|
|
|
|
|
|
|
|
public function svipUpdate($id) |
|
|
|
|
{ |
|
|
|
|
$data = $this->request->params(['is_svip','add_time','type']); |
|
|
|
|
$this->repository->svipUpdate($id, $data,$this->request->adminId()); |
|
|
|
|
$data = $this->request->params(['is_svip', 'add_time', 'type']); |
|
|
|
|
$this->repository->svipUpdate($id, $data, $this->request->adminId()); |
|
|
|
|
return app('json')->success('修改成功'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -608,18 +608,25 @@ class User extends BaseController |
|
|
|
|
return app('json')->success(formToData($partnerRepository->changePartnerForm($id))); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function changePartner(PartnerRepository $partnerRepository,UserPartnerRepository $userPartnerRepository) |
|
|
|
|
public function changePartner(PartnerRepository $partnerRepository, UserPartnerRepository $userPartnerRepository) |
|
|
|
|
{ |
|
|
|
|
$partner_id = (array)$this->request->param('partner_id', []); |
|
|
|
|
$user_role_id = (array)$this->request->param('user_role_id', []); |
|
|
|
|
$partner_ids = $user_role_ids = []; |
|
|
|
|
$id = (int)$this->request->param('uid', ''); |
|
|
|
|
if (!$this->repository->exists($id)) |
|
|
|
|
return app('json')->fail('数据不存在'); |
|
|
|
|
foreach ($partner_id as $k => $value) { |
|
|
|
|
$partner_id[$k] = (int)$value; |
|
|
|
|
$partner_ids[$k] = (int)$value; |
|
|
|
|
if (!$partnerRepository->exists((int)$value)) |
|
|
|
|
return app('json')->fail('所选合作人角色不存在'); |
|
|
|
|
} |
|
|
|
|
$userPartnerRepository->editPartner($id, $partner_id); |
|
|
|
|
foreach ($user_role_id as $k => $value) { |
|
|
|
|
$user_role_id[$k] = (int)$value; |
|
|
|
|
if (!$partnerRepository->roleExists((int)$value)) |
|
|
|
|
return app('json')->fail('该位置已分配,请重新选择'); |
|
|
|
|
} |
|
|
|
|
$userPartnerRepository->editPartner($id, $user_role_id); |
|
|
|
|
return app('json')->success('修改成功'); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|