|
@@ -46,7 +46,7 @@ class SystemSupplier extends AuthController
|
|
|
[['keywords', 's'], ''],
|
|
|
]);
|
|
|
$where['is_del'] = 0;
|
|
|
- return $this->success($this->services->getSupplierList($where, ['id', 'supplier_name', 'name', 'phone', 'address', 'is_show', 'add_time', 'mark', 'sort']));
|
|
|
+ return $this->success($this->services->getSupplierList($where, ['id', 'supplier_name', 'name', 'phone', 'address', 'is_show', 'add_time', 'mark', 'sort', 'valid_time']));
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -76,12 +76,12 @@ class SystemSupplier extends AuthController
|
|
|
['mark', '']
|
|
|
]);
|
|
|
$this->validate($data, \app\validate\supplier\SystemSupplierValidate::class, 'save');
|
|
|
- if (!$data['pwd']) {
|
|
|
- return $this->fail('请输入登录密码');
|
|
|
- }
|
|
|
- if ($data['conf_pwd'] != $data['pwd']) {
|
|
|
- return $this->fail('两次输入的密码不相同');
|
|
|
- }
|
|
|
+ if (!$data['pwd']) {
|
|
|
+ return $this->fail('请输入登录密码');
|
|
|
+ }
|
|
|
+ if ($data['conf_pwd'] != $data['pwd']) {
|
|
|
+ return $this->fail('两次输入的密码不相同');
|
|
|
+ }
|
|
|
$this->services->create($data);
|
|
|
return $this->success('添加成功');
|
|
|
}
|
|
@@ -117,14 +117,14 @@ class SystemSupplier extends AuthController
|
|
|
|
|
|
$this->validate($data, \app\validate\supplier\SystemSupplierValidate::class, 'admin_update');
|
|
|
|
|
|
- if ($data['pwd']) {
|
|
|
- if (!$data['conf_pwd']) {
|
|
|
- return $this->fail('请输入确认密码');
|
|
|
- }
|
|
|
- if ($data['conf_pwd'] != $data['pwd']) {
|
|
|
- return $this->fail('上次输入的密码不相同');
|
|
|
- }
|
|
|
- }
|
|
|
+ if ($data['pwd']) {
|
|
|
+ if (!$data['conf_pwd']) {
|
|
|
+ return $this->fail('请输入确认密码');
|
|
|
+ }
|
|
|
+ if ($data['conf_pwd'] != $data['pwd']) {
|
|
|
+ return $this->fail('上次输入的密码不相同');
|
|
|
+ }
|
|
|
+ }
|
|
|
$this->services->save((int)$id, $data);
|
|
|
return $this->success('修改成功');
|
|
|
}
|
|
@@ -161,9 +161,9 @@ class SystemSupplier extends AuthController
|
|
|
{
|
|
|
if (!$id) return $this->fail('缺少参数');
|
|
|
$info = $this->services->getSupplierInfo((int)$id, 'id, supplier_name, name, phone, admin_id, email, address, province, city, area, street, detailed_address, sort, is_show, mark', ['admin']);
|
|
|
- $info->hidden(['roles', 'admin_is_del', 'admin_type', 'level','admin_id']);
|
|
|
+ $info->hidden(['roles', 'admin_is_del', 'admin_type', 'level', 'admin_id']);
|
|
|
$info = $info->toArray();
|
|
|
- $info['pwd'] = '';
|
|
|
+ $info['pwd'] = '';
|
|
|
return $this->success($info);
|
|
|
}
|
|
|
|