|
|
|
@ -14,6 +14,7 @@ |
|
|
|
|
namespace app\controller\admin\system\admin; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
use app\common\model\user\UserPartner; |
|
|
|
|
use app\common\repositories\system\admin\PartnerRepository; |
|
|
|
|
use crmeb\basic\BaseController; |
|
|
|
|
use app\validate\admin\PartnerRoleValidate; |
|
|
|
@ -73,6 +74,9 @@ class Partner extends BaseController |
|
|
|
|
) { |
|
|
|
|
return app('json')->fail('请补全对应角色类型的关联数据'); |
|
|
|
|
} |
|
|
|
|
unset($data['district_id']); |
|
|
|
|
unset($data['province_id']); |
|
|
|
|
unset($data['city_id']); |
|
|
|
|
$this->repository->create($data); |
|
|
|
|
return app('json')->success('添加成功'); |
|
|
|
|
} |
|
|
|
@ -82,7 +86,8 @@ class Partner extends BaseController |
|
|
|
|
|
|
|
|
|
$data = $this->request->params(['name', 'ratio', 'is_area', 'area_level', |
|
|
|
|
'province_id', 'city_id', 'district_id', |
|
|
|
|
'area_id', ['status', 1], ['type', 1], 'brand_id', 'trade_id', 'id', 'region_id']); |
|
|
|
|
'area_id', ['status', 1], ['type', 1], 'brand_id', 'trade_id', 'id', 'region_id', |
|
|
|
|
['max_role_num', 1]]); |
|
|
|
|
$validate->check($data); |
|
|
|
|
|
|
|
|
|
if ($data['is_area'] == 1) { |
|
|
|
@ -109,7 +114,9 @@ class Partner extends BaseController |
|
|
|
|
) { |
|
|
|
|
return app('json')->fail('请补全对应角色类型的关联数据'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
unset($data['district_id']); |
|
|
|
|
unset($data['province_id']); |
|
|
|
|
unset($data['city_id']); |
|
|
|
|
$this->repository->update($data['id'], $data); |
|
|
|
|
|
|
|
|
|
return app('json')->success('编辑成功'); |
|
|
|
|