|
@@ -70,6 +70,7 @@ class SystemStoreStaff extends AuthController
|
|
|
Form::radio('status', '状态', 1)->options([['value' => 1, 'label' => '开启'], ['value' => 0, 'label' => '关闭']]),
|
|
|
Form::radio('coupon_status', '添加优惠券状态', 1)->options([['value' => 1, 'label' => '开启'], ['value' => 0, 'label' => '关闭']]),
|
|
|
Form::radio('price_status', '收款状态', 0)->options([['value' => 1, 'label' => '开启'], ['value' => 0, 'label' => '关闭']]),
|
|
|
+ Form::radio('is_total', '总帐号', 0)->options([['value' => 1, 'label' => '开启'], ['value' => 0, 'label' => '关闭']]),
|
|
|
];
|
|
|
$form = Form::make_post_form('添加评论', $field, Url::buildUrl('save'), 2);
|
|
|
$this->assign(compact('form'));
|
|
@@ -113,6 +114,7 @@ class SystemStoreStaff extends AuthController
|
|
|
Form::radio('status', '状态', $service['status'])->options([['value' => 1, 'label' => '开启'], ['value' => 0, 'label' => '关闭']]),
|
|
|
Form::radio('coupon_status', '添加优惠券状态', $service['coupon_status'])->options([['value' => 1, 'label' => '开启'], ['value' => 0, 'label' => '关闭']]),
|
|
|
Form::radio('price_status', '收款状态', $service['price_status'])->options([['value' => 1, 'label' => '开启'], ['value' => 0, 'label' => '关闭']]),
|
|
|
+ Form::radio('is_total', '总帐号', $service['is_total'])->options([['value' => 1, 'label' => '开启'], ['value' => 0, 'label' => '关闭']]),
|
|
|
];
|
|
|
|
|
|
$form = Form::make_post_form('修改数据', $f, Url::buildUrl('save', compact('id')));
|
|
@@ -165,7 +167,8 @@ class SystemStoreStaff extends AuthController
|
|
|
['verify_status', 1],
|
|
|
['status', 1],
|
|
|
['coupon_status'],
|
|
|
- ['price_status']
|
|
|
+ ['price_status'],
|
|
|
+ ['is_total'],
|
|
|
]);
|
|
|
if (!$id) {
|
|
|
if (StaffModel::where('uid', $data['uid'])->count()) return Json::fail('添加的店员用户已存在!');
|
|
@@ -176,6 +179,10 @@ class SystemStoreStaff extends AuthController
|
|
|
$store = \app\admin\model\system\SystemStoreStaff::where('store_id', $data['store_id'])->where('uid', '<>',$data['uid'])->where('price_status', 1)->find();
|
|
|
if ($store) return Json::fail('已有收款账户不能添加第二位');
|
|
|
}
|
|
|
+ if ($data['is_total'] == 1) {
|
|
|
+ $store = \app\admin\model\system\SystemStoreStaff::where('store_id', $data['store_id'])->where('uid', '<>',$data['uid'])->where('is_total', 1)->find();
|
|
|
+ if ($store) return Json::fail('已有总帐号');
|
|
|
+ }
|
|
|
if ($id) {
|
|
|
$res = StaffModel::edit($data, $id);
|
|
|
if ($res) {
|