作者 Cool

商家入驻审核调试

@@ -107,6 +107,15 @@ class Store extends Backend @@ -107,6 +107,15 @@ class Store extends Backend
107 $admin_model = new Admin(); 107 $admin_model = new Admin();
108 $auth_group_model = new AuthGroupAccess(); 108 $auth_group_model = new AuthGroupAccess();
109 if($params['status'] == 3) { 109 if($params['status'] == 3) {
  110 + if(empty($params['username'])) {
  111 + $this->error('请填写账号');
  112 + }
  113 + if(empty($params['nickname'])) {
  114 + $this->error('请填写昵称');
  115 + }
  116 + if(empty($params['password'])) {
  117 + $this->error('请填写密码');
  118 + }
110 $salt = Random::alnum(); 119 $salt = Random::alnum();
111 $password = md5(md5($params['password']) . $salt); 120 $password = md5(md5($params['password']) . $salt);
112 $admin_data = [ 121 $admin_data = [
@@ -6,22 +6,22 @@ @@ -6,22 +6,22 @@
6 {:build_radios('row[status]', ['2'=>__('Status 2'), '3'=>__('Status 3'), '4'=>__('Status 4')])} 6 {:build_radios('row[status]', ['2'=>__('Status 2'), '3'=>__('Status 3'), '4'=>__('Status 4')])}
7 </div> 7 </div>
8 </div> 8 </div>
9 - <div class="form-group"> 9 + <div class="form-group" id="username" style="display: none;">
10 <label class="control-label col-xs-12 col-sm-2">{:__('Username')}:</label> 10 <label class="control-label col-xs-12 col-sm-2">{:__('Username')}:</label>
11 <div class="col-xs-12 col-sm-8"> 11 <div class="col-xs-12 col-sm-8">
12 - <input id="c-username" data-rule="required" class="form-control" name="row[username]" type="text" value="{$row.mobile|htmlentities}"> 12 + <input id="c-username" data-rule="" class="form-control" name="row[username]" type="text" value="{$row.mobile|htmlentities}">
13 </div> 13 </div>
14 </div> 14 </div>
15 - <div class="form-group"> 15 + <div class="form-group" id="nickname" style="display: none;">
16 <label class="control-label col-xs-12 col-sm-2">{:__('Admin.nickname')}:</label> 16 <label class="control-label col-xs-12 col-sm-2">{:__('Admin.nickname')}:</label>
17 <div class="col-xs-12 col-sm-8"> 17 <div class="col-xs-12 col-sm-8">
18 - <input id="c-nickname" data-rule="required" class="form-control" name="row[nickname]" type="text" value=""> 18 + <input id="c-nickname" data-rule="" class="form-control" name="row[nickname]" type="text" value="">
19 </div> 19 </div>
20 </div> 20 </div>
21 - <div class="form-group"> 21 + <div class="form-group" id="password" style="display: none;">
22 <label for="password" class="control-label col-xs-12 col-sm-2">{:__('Password')}:</label> 22 <label for="password" class="control-label col-xs-12 col-sm-2">{:__('Password')}:</label>
23 <div class="col-xs-12 col-sm-8"> 23 <div class="col-xs-12 col-sm-8">
24 - <input type="password" class="form-control" id="password" name="row[password]" autocomplete="new-password" value="" data-rule="required;password" /> 24 + <input type="password" class="form-control" name="row[password]" autocomplete="new-password" value="" data-rule="password" />
25 </div> 25 </div>
26 </div> 26 </div>
27 <div class="form-group layer-footer"> 27 <div class="form-group layer-footer">
@@ -113,7 +113,15 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin @@ -113,7 +113,15 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
113 change: function () { 113 change: function () {
114 $('input[name="row[status]"]').change(function () { 114 $('input[name="row[status]"]').change(function () {
115 var value = $(this).val(); 115 var value = $(this).val();
116 - console.log(value); 116 + if(value == 3) {
  117 + $('#username').show();
  118 + $('#nickname').show();
  119 + $('#password').show();
  120 + } else {
  121 + $('#username').hide();
  122 + $('#nickname').hide();
  123 + $('#password').hide();
  124 + }
117 }); 125 });
118 } 126 }
119 } 127 }