作者 李忠强

更新

@@ -3,6 +3,10 @@ @@ -3,6 +3,10 @@
3 namespace app\admin\controller; 3 namespace app\admin\controller;
4 4
5 use app\common\controller\Backend; 5 use app\common\controller\Backend;
  6 +use think\Db;
  7 +use Exception;
  8 +use think\exception\PDOException;
  9 +use think\exception\ValidateException;
6 10
7 /** 11 /**
8 * 发票管理 12 * 发票管理
@@ -73,4 +77,58 @@ class Tax extends Backend @@ -73,4 +77,58 @@ class Tax extends Backend
73 return $this->view->fetch(); 77 return $this->view->fetch();
74 } 78 }
75 79
  80 +
  81 + /**
  82 + * 编辑
  83 + */
  84 + public function edit($ids = null)
  85 + {
  86 + $row = $this->model->get($ids);
  87 + if (!$row) {
  88 + $this->error(__('No Results were found'));
  89 + }
  90 + $adminIds = $this->getDataLimitAdminIds();
  91 + if (is_array($adminIds)) {
  92 + if (!in_array($row[$this->dataLimitField], $adminIds)) {
  93 + $this->error(__('You have no permission'));
  94 + }
  95 + }
  96 + if ($this->request->isPost()) {
  97 + $params = $this->request->post("row/a");
  98 + if ($params) {
  99 + $params = $this->preExcludeFields($params);
  100 + $result = false;
  101 + Db::startTrans();
  102 + try {
  103 + //是否采用模型验证
  104 + if ($this->modelValidate) {
  105 + $name = str_replace("\\model\\", "\\validate\\", get_class($this->model));
  106 + $validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.edit' : $name) : $this->modelValidate;
  107 + $row->validateFailException(true)->validate($validate);
  108 + }
  109 + $params['status'] ='1';
  110 + $params['tax_time'] =time();
  111 + $result = $row->allowField(true)->save($params);
  112 + Db::commit();
  113 + } catch (ValidateException $e) {
  114 + Db::rollback();
  115 + $this->error($e->getMessage());
  116 + } catch (PDOException $e) {
  117 + Db::rollback();
  118 + $this->error($e->getMessage());
  119 + } catch (Exception $e) {
  120 + Db::rollback();
  121 + $this->error($e->getMessage());
  122 + }
  123 + if ($result !== false) {
  124 + $this->success();
  125 + } else {
  126 + $this->error(__('No rows were updated'));
  127 + }
  128 + }
  129 + $this->error(__('Parameter %s can not be empty', ''));
  130 + }
  131 + $this->view->assign("row", $row);
  132 + return $this->view->fetch();
  133 + }
76 } 134 }
@@ -41,7 +41,6 @@ class User extends Backend @@ -41,7 +41,6 @@ class User extends Backend
41 } 41 }
42 list($where, $sort, $order, $offset, $limit) = $this->buildparams(); 42 list($where, $sort, $order, $offset, $limit) = $this->buildparams();
43 $list = $this->model 43 $list = $this->model
44 - ->with('group')  
45 ->where($where) 44 ->where($where)
46 ->order($sort, $order) 45 ->order($sort, $order)
47 ->paginate($limit); 46 ->paginate($limit);
@@ -30,4 +30,12 @@ return [ @@ -30,4 +30,12 @@ return [
30 'Token' => 'Token', 30 'Token' => 'Token',
31 'Status' => '状态', 31 'Status' => '状态',
32 'Leave password blank if dont want to change' => '不修改密码请留空', 32 'Leave password blank if dont want to change' => '不修改密码请留空',
  33 + 'User_type' => '用户角色',
  34 + 'User_type 1' => '普通用户',
  35 + 'User_type 2' => '骑手',
  36 + 'Rider' => '申请骑手状态',
  37 + 'Rider 0' => '无',
  38 + 'Rider 1' => '申请中',
  39 + 'Rider 2' => '成功',
  40 + 'Rider 3' => '拒绝',
33 ]; 41 ];
@@ -7,18 +7,18 @@ @@ -7,18 +7,18 @@
7 <div class="widget-body no-padding"> 7 <div class="widget-body no-padding">
8 <div id="toolbar" class="toolbar"> 8 <div id="toolbar" class="toolbar">
9 <a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a> 9 <a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
10 - <a href="javascript:;" class="btn btn-success btn-add {:$auth->check('activity/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a> 10 +<!-- <a href="javascript:;" class="btn btn-success btn-add {:$auth->check('activity/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>-->
11 <a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('activity/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a> 11 <a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('activity/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
12 - <a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('activity/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>  
13 - <a href="javascript:;" class="btn btn-danger btn-import {:$auth->check('activity/import')?'':'hide'}" title="{:__('Import')}" id="btn-import-file" data-url="ajax/upload" data-mimetype="csv,xls,xlsx" data-multiple="false"><i class="fa fa-upload"></i> {:__('Import')}</a> 12 +<!-- <a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('activity/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>-->
  13 +<!-- <a href="javascript:;" class="btn btn-danger btn-import {:$auth->check('activity/import')?'':'hide'}" title="{:__('Import')}" id="btn-import-file" data-url="ajax/upload" data-mimetype="csv,xls,xlsx" data-multiple="false"><i class="fa fa-upload"></i> {:__('Import')}</a>-->
14 14
15 - <div class="dropdown btn-group {:$auth->check('activity/multi')?'':'hide'}">  
16 - <a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>  
17 - <ul class="dropdown-menu text-left" role="menu">  
18 - <li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li>  
19 - <li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to hidden')}</a></li>  
20 - </ul>  
21 - </div> 15 +<!-- <div class="dropdown btn-group {:$auth->check('activity/multi')?'':'hide'}">-->
  16 +<!-- <a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>-->
  17 +<!-- <ul class="dropdown-menu text-left" role="menu">-->
  18 +<!-- <li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li>-->
  19 +<!-- <li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to hidden')}</a></li>-->
  20 +<!-- </ul>-->
  21 +<!-- </div>-->
22 22
23 23
24 </div> 24 </div>
1 <form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action=""> 1 <form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
2 2
3 <div class="form-group"> 3 <div class="form-group">
4 - <label class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>  
5 - <div class="col-xs-12 col-sm-8">  
6 - <input id="c-user_id" data-rule="required" min="0" data-source="user/user/index" data-field="nickname" class="form-control selectpage" name="row[user_id]" type="text" value="{$row.user_id|htmlentities}">  
7 - </div>  
8 - </div>  
9 - <div class="form-group">  
10 - <label class="control-label col-xs-12 col-sm-2">{:__('Order_id')}:</label>  
11 - <div class="col-xs-12 col-sm-8">  
12 - <input id="c-order_id" data-rule="required" min="0" data-source="order/index" class="form-control selectpage" name="row[order_id]" type="text" value="{$row.order_id|htmlentities}">  
13 - </div>  
14 - </div>  
15 - <div class="form-group">  
16 <label class="control-label col-xs-12 col-sm-2">{:__('Order_no')}:</label> 4 <label class="control-label col-xs-12 col-sm-2">{:__('Order_no')}:</label>
17 <div class="col-xs-12 col-sm-8"> 5 <div class="col-xs-12 col-sm-8">
18 - <input id="c-order_no" data-rule="required" class="form-control" name="row[order_no]" type="text" value="{$row.order_no|htmlentities}"> 6 + <input id="c-order_no" readonly="readonly" data-rule="required" class="form-control" name="row[order_no]" type="text" value="{$row.order_no|htmlentities}">
19 </div> 7 </div>
20 </div> 8 </div>
21 <div class="form-group"> 9 <div class="form-group">
22 <label class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label> 10 <label class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
23 <div class="col-xs-12 col-sm-8"> 11 <div class="col-xs-12 col-sm-8">
24 12
25 - <select id="c-type" data-rule="required" class="form-control selectpicker" name="row[type]"> 13 + <select id="c-type" disabled data-rule="required" class="form-control selectpicker" name="row[type]">
26 {foreach name="typeList" item="vo"} 14 {foreach name="typeList" item="vo"}
27 - <option value="{$key}" {in name="key" value="$row.type"}selected{/in}>{$vo}</option> 15 + <option value="{$key}" {in name="key" value="$row.type"}selected{/in}>{$vo}</option>.
28 {/foreach} 16 {/foreach}
29 </select> 17 </select>
30 18
@@ -33,7 +21,7 @@ @@ -33,7 +21,7 @@
33 <div class="form-group"> 21 <div class="form-group">
34 <label class="control-label col-xs-12 col-sm-2">{:__('Price')}:</label> 22 <label class="control-label col-xs-12 col-sm-2">{:__('Price')}:</label>
35 <div class="col-xs-12 col-sm-8"> 23 <div class="col-xs-12 col-sm-8">
36 - <input id="c-price" class="form-control" step="0.01" name="row[price]" type="number" value="{$row.price|htmlentities}"> 24 + <input id="c-price" class="form-control" data-rule="required" step="0.01" name="row[price]" type="number" value="{$row.price|htmlentities}">
37 </div> 25 </div>
38 </div> 26 </div>
39 <div class="form-group"> 27 <div class="form-group">
@@ -87,16 +75,16 @@ @@ -87,16 +75,16 @@
87 <div class="form-group"> 75 <div class="form-group">
88 <label class="control-label col-xs-12 col-sm-2">{:__('Tax_time')}:</label> 76 <label class="control-label col-xs-12 col-sm-2">{:__('Tax_time')}:</label>
89 <div class="col-xs-12 col-sm-8"> 77 <div class="col-xs-12 col-sm-8">
90 - <input id="c-tax_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[tax_time]" type="text" value="{:$row.tax_time?datetime($row.tax_time):''}"> 78 + <input id="c-tax_time" data-rule="required" disabled class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[tax_time]" type="text" value="{:$row.tax_time?datetime($row.tax_time):''}">
91 </div> 79 </div>
92 </div> 80 </div>
93 <div class="form-group"> 81 <div class="form-group">
94 <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label> 82 <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
95 <div class="col-xs-12 col-sm-8"> 83 <div class="col-xs-12 col-sm-8">
96 - 84 +
97 <div class="radio"> 85 <div class="radio">
98 {foreach name="statusList" item="vo"} 86 {foreach name="statusList" item="vo"}
99 - <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="$row.status"}checked{/in} /> {$vo}</label> 87 + <label for="row[status]-{$key}"><input id="row[status]-{$key}" disabled name="row[status]" type="radio" value="{$key}" {in name="key" value="$row.status"}checked{/in} /> {$vo}</label>
100 {/foreach} 88 {/foreach}
101 </div> 89 </div>
102 90
@@ -108,7 +96,7 @@ @@ -108,7 +96,7 @@
108 96
109 <div class="radio"> 97 <div class="radio">
110 {foreach name="delStatusList" item="vo"} 98 {foreach name="delStatusList" item="vo"}
111 - <label for="row[del_status]-{$key}"><input id="row[del_status]-{$key}" name="row[del_status]" type="radio" value="{$key}" {in name="key" value="$row.del_status"}checked{/in} /> {$vo}</label> 99 + <label for="row[del_status]-{$key}"><input disabled id="row[del_status]-{$key}" name="row[del_status]" type="radio" value="{$key}" {in name="key" value="$row.del_status"}checked{/in} /> {$vo}</label>
112 {/foreach} 100 {/foreach}
113 </div> 101 </div>
114 102
@@ -117,8 +105,9 @@ @@ -117,8 +105,9 @@
117 <div class="form-group layer-footer"> 105 <div class="form-group layer-footer">
118 <label class="control-label col-xs-12 col-sm-2"></label> 106 <label class="control-label col-xs-12 col-sm-2"></label>
119 <div class="col-xs-12 col-sm-8"> 107 <div class="col-xs-12 col-sm-8">
  108 + {neq name="$row.status" value='1'}
120 <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button> 109 <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
121 - <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button> 110 + {/neq}
122 </div> 111 </div>
123 </div> 112 </div>
124 </form> 113 </form>
@@ -2,18 +2,6 @@ @@ -2,18 +2,6 @@
2 {:token()} 2 {:token()}
3 <input type="hidden" name="row[id]" value="{$row.id}"> 3 <input type="hidden" name="row[id]" value="{$row.id}">
4 <div class="form-group"> 4 <div class="form-group">
5 - <label for="c-group_id" class="control-label col-xs-12 col-sm-2">{:__('Group')}:</label>  
6 - <div class="col-xs-12 col-sm-4">  
7 - {$groupList}  
8 - </div>  
9 - </div>  
10 - <div class="form-group">  
11 - <label for="c-username" class="control-label col-xs-12 col-sm-2">{:__('Username')}:</label>  
12 - <div class="col-xs-12 col-sm-4">  
13 - <input id="c-username" data-rule="required" class="form-control" name="row[username]" type="text" value="{$row.username|htmlentities}">  
14 - </div>  
15 - </div>  
16 - <div class="form-group">  
17 <label for="c-nickname" class="control-label col-xs-12 col-sm-2">{:__('Nickname')}:</label> 5 <label for="c-nickname" class="control-label col-xs-12 col-sm-2">{:__('Nickname')}:</label>
18 <div class="col-xs-12 col-sm-4"> 6 <div class="col-xs-12 col-sm-4">
19 <input id="c-nickname" data-rule="required" class="form-control" name="row[nickname]" type="text" value="{$row.nickname|htmlentities}"> 7 <input id="c-nickname" data-rule="required" class="form-control" name="row[nickname]" type="text" value="{$row.nickname|htmlentities}">
@@ -26,12 +14,6 @@ @@ -26,12 +14,6 @@
26 </div> 14 </div>
27 </div> 15 </div>
28 <div class="form-group"> 16 <div class="form-group">
29 - <label for="c-email" class="control-label col-xs-12 col-sm-2">{:__('Email')}:</label>  
30 - <div class="col-xs-12 col-sm-4">  
31 - <input id="c-email" data-rule="" class="form-control" name="row[email]" type="text" value="{$row.email|htmlentities}">  
32 - </div>  
33 - </div>  
34 - <div class="form-group">  
35 <label for="c-mobile" class="control-label col-xs-12 col-sm-2">{:__('Mobile')}:</label> 17 <label for="c-mobile" class="control-label col-xs-12 col-sm-2">{:__('Mobile')}:</label>
36 <div class="col-xs-12 col-sm-4"> 18 <div class="col-xs-12 col-sm-4">
37 <input id="c-mobile" data-rule="" class="form-control" name="row[mobile]" type="text" value="{$row.mobile|htmlentities}"> 19 <input id="c-mobile" data-rule="" class="form-control" name="row[mobile]" type="text" value="{$row.mobile|htmlentities}">
@@ -52,89 +34,19 @@ @@ -52,89 +34,19 @@
52 </div> 34 </div>
53 </div> 35 </div>
54 <div class="form-group"> 36 <div class="form-group">
55 - <label for="c-level" class="control-label col-xs-12 col-sm-2">{:__('Level')}:</label>  
56 - <div class="col-xs-12 col-sm-4">  
57 - <input id="c-level" data-rule="required" class="form-control" name="row[level]" type="number" value="{$row.level}">  
58 - </div>  
59 - </div>  
60 - <div class="form-group">  
61 - <label for="c-gender" class="control-label col-xs-12 col-sm-2">{:__('Gender')}:</label>  
62 - <div class="col-xs-12 col-sm-8">  
63 - {:build_radios('row[gender]', ['1'=>__('Male'), '0'=>__('Female')], $row['gender'])}  
64 - </div>  
65 - </div>  
66 - <div class="form-group">  
67 - <label for="c-birthday" class="control-label col-xs-12 col-sm-2">{:__('Birthday')}:</label>  
68 - <div class="col-xs-12 col-sm-4">  
69 - <input id="c-birthday" data-rule="" class="form-control datetimepicker" data-date-format="YYYY-MM-DD" data-use-current="true" name="row[birthday]" type="text" value="{$row.birthday}">  
70 - </div>  
71 - </div>  
72 - <div class="form-group">  
73 - <label for="c-bio" class="control-label col-xs-12 col-sm-2">{:__('Bio')}:</label>  
74 - <div class="col-xs-12 col-sm-8">  
75 - <input id="c-bio" data-rule="" class="form-control" name="row[bio]" type="text" value="{$row.bio|htmlentities}">  
76 - </div>  
77 - </div>  
78 - <div class="form-group">  
79 <label for="c-money" class="control-label col-xs-12 col-sm-2">{:__('Money')}:</label> 37 <label for="c-money" class="control-label col-xs-12 col-sm-2">{:__('Money')}:</label>
80 <div class="col-xs-12 col-sm-4"> 38 <div class="col-xs-12 col-sm-4">
81 <input id="c-money" data-rule="required" class="form-control" name="row[money]" type="number" value="{$row.money}"> 39 <input id="c-money" data-rule="required" class="form-control" name="row[money]" type="number" value="{$row.money}">
82 </div> 40 </div>
83 </div> 41 </div>
  42 + {eq name="$row.rider" value="1"}
84 <div class="form-group"> 43 <div class="form-group">
85 - <label for="c-score" class="control-label col-xs-12 col-sm-2">{:__('Score')}:</label>  
86 - <div class="col-xs-12 col-sm-4">  
87 - <input id="c-score" data-rule="required" class="form-control" name="row[score]" type="number" value="{$row.score}">  
88 - </div>  
89 - </div>  
90 - <div class="form-group">  
91 - <label for="c-successions" class="control-label col-xs-12 col-sm-2">{:__('Successions')}:</label>  
92 - <div class="col-xs-12 col-sm-4">  
93 - <input id="c-successions" data-rule="required" class="form-control" name="row[successions]" type="number" value="{$row.successions}">  
94 - </div>  
95 - </div>  
96 - <div class="form-group">  
97 - <label for="c-maxsuccessions" class="control-label col-xs-12 col-sm-2">{:__('Maxsuccessions')}:</label>  
98 - <div class="col-xs-12 col-sm-4">  
99 - <input id="c-maxsuccessions" data-rule="required" class="form-control" name="row[maxsuccessions]" type="number" value="{$row.maxsuccessions}">  
100 - </div>  
101 - </div>  
102 - <div class="form-group">  
103 - <label for="c-prevtime" class="control-label col-xs-12 col-sm-2">{:__('Prevtime')}:</label>  
104 - <div class="col-xs-12 col-sm-4">  
105 - <input id="c-prevtime" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[prevtime]" type="text" value="{$row.prevtime|datetime}">  
106 - </div>  
107 - </div>  
108 - <div class="form-group">  
109 - <label for="c-logintime" class="control-label col-xs-12 col-sm-2">{:__('Logintime')}:</label>  
110 - <div class="col-xs-12 col-sm-4">  
111 - <input id="c-logintime" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[logintime]" type="text" value="{$row.logintime|datetime}">  
112 - </div>  
113 - </div>  
114 - <div class="form-group">  
115 - <label for="c-loginip" class="control-label col-xs-12 col-sm-2">{:__('Loginip')}:</label>  
116 - <div class="col-xs-12 col-sm-4">  
117 - <input id="c-loginip" data-rule="required" class="form-control" name="row[loginip]" type="text" value="{$row.loginip}">  
118 - </div>  
119 - </div>  
120 - <div class="form-group">  
121 - <label for="c-loginfailure" class="control-label col-xs-12 col-sm-2">{:__('Loginfailure')}:</label>  
122 - <div class="col-xs-12 col-sm-4">  
123 - <input id="c-loginfailure" data-rule="required" class="form-control" name="row[loginfailure]" type="number" value="{$row.loginfailure}">  
124 - </div>  
125 - </div>  
126 - <div class="form-group">  
127 - <label for="c-joinip" class="control-label col-xs-12 col-sm-2">{:__('Joinip')}:</label>  
128 - <div class="col-xs-12 col-sm-4">  
129 - <input id="c-joinip" data-rule="required" class="form-control" name="row[joinip]" type="text" value="{$row.joinip}">  
130 - </div>  
131 - </div>  
132 - <div class="form-group">  
133 - <label for="c-jointime" class="control-label col-xs-12 col-sm-2">{:__('Jointime')}:</label>  
134 - <div class="col-xs-12 col-sm-4">  
135 - <input id="c-jointime" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[jointime]" type="text" value="{$row.jointime|datetime}"> 44 + <label for="content" class="control-label col-xs-12 col-sm-2">{:__('Rider')}:</label>
  45 + <div class="col-xs-12 col-sm-8">
  46 + {:build_radios('row[rider]', ['0'=>__('Rider 0'), '1'=>__('Rider 1'), '2'=>__('Rider 2'), '3'=>__('Rider 3')], $row['rider'])}
136 </div> 47 </div>
137 </div> 48 </div>
  49 + {/eq}
138 <div class="form-group"> 50 <div class="form-group">
139 <label for="content" class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label> 51 <label for="content" class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
140 <div class="col-xs-12 col-sm-8"> 52 <div class="col-xs-12 col-sm-8">
@@ -8,7 +8,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin @@ -8,7 +8,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
8 index_url: 'activity/index' + location.search, 8 index_url: 'activity/index' + location.search,
9 add_url: 'activity/add', 9 add_url: 'activity/add',
10 edit_url: 'activity/edit', 10 edit_url: 'activity/edit',
11 - del_url: 'activity/del', 11 + // del_url: 'activity/del',
12 multi_url: 'activity/multi', 12 multi_url: 'activity/multi',
13 import_url: 'activity/import', 13 import_url: 'activity/import',
14 table: 'activity', 14 table: 'activity',
@@ -22,6 +22,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin @@ -22,6 +22,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
22 url: $.fn.bootstrapTable.defaults.extend.index_url, 22 url: $.fn.bootstrapTable.defaults.extend.index_url,
23 pk: 'id', 23 pk: 'id',
24 sortName: 'id', 24 sortName: 'id',
  25 + search:false,
  26 + showSearch:false,
  27 + showExport:false,
25 columns: [ 28 columns: [
26 [ 29 [
27 {checkbox: true}, 30 {checkbox: true},
@@ -27,9 +27,11 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin @@ -27,9 +27,11 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
27 columns: [ 27 columns: [
28 [ 28 [
29 {checkbox: true}, 29 {checkbox: true},
30 - {field: 'id', title: __('Id')},  
31 - {field: 'user_id', title: __('User_id')},  
32 - {field: 'order_id', title: __('Order_id')}, 30 + {field: 'id', title: __('Id'),operate: false},
  31 + {field: 'user_id', title: __('User_id'),visible:false},
  32 + {field: 'user.nickname', title: __('User.nickname'), operate: false},
  33 + {field: 'user.avatar', title: __('User.avatar'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
  34 + {field: 'order_id', title: __('Order_id'),operate: false,visible:false},
33 {field: 'order_no', title: __('Order_no'), operate: 'LIKE'}, 35 {field: 'order_no', title: __('Order_no'), operate: 'LIKE'},
34 {field: 'type', title: __('Type'), searchList: {"1":__('Type 1'),"2":__('Type 2')}, formatter: Table.api.formatter.normal}, 36 {field: 'type', title: __('Type'), searchList: {"1":__('Type 1'),"2":__('Type 2')}, formatter: Table.api.formatter.normal},
35 {field: 'price', title: __('Price'), operate:'BETWEEN'}, 37 {field: 'price', title: __('Price'), operate:'BETWEEN'},
@@ -38,15 +40,13 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin @@ -38,15 +40,13 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
38 {field: 'tax_number', title: __('Tax_number'), operate: 'LIKE'}, 40 {field: 'tax_number', title: __('Tax_number'), operate: 'LIKE'},
39 {field: 'company_address', title: __('Company_address'), operate: 'LIKE'}, 41 {field: 'company_address', title: __('Company_address'), operate: 'LIKE'},
40 {field: 'company_mobile', title: __('Company_mobile'), operate: 'LIKE'}, 42 {field: 'company_mobile', title: __('Company_mobile'), operate: 'LIKE'},
41 - {field: 'bank', title: __('Bank'), operate: 'LIKE'}, 43 + {field: 'bank', title: __('Bank'), operate: false,visible:false},
42 {field: 'mobile', title: __('Mobile'), operate: 'LIKE'}, 44 {field: 'mobile', title: __('Mobile'), operate: 'LIKE'},
43 {field: 'email', title: __('Email'), operate: 'LIKE'}, 45 {field: 'email', title: __('Email'), operate: 'LIKE'},
44 {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, 46 {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
45 {field: 'tax_time', title: __('Tax_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, 47 {field: 'tax_time', title: __('Tax_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
46 {field: 'status', title: __('Status'), searchList: {"0":__('Status 0'),"1":__('Status 1')}, formatter: Table.api.formatter.status}, 48 {field: 'status', title: __('Status'), searchList: {"0":__('Status 0'),"1":__('Status 1')}, formatter: Table.api.formatter.status},
47 {field: 'del_status', title: __('Del_status'), searchList: {"normal":__('Del_status normal'),"hidden":__('Del_status hidden')}, formatter: Table.api.formatter.status}, 49 {field: 'del_status', title: __('Del_status'), searchList: {"normal":__('Del_status normal'),"hidden":__('Del_status hidden')}, formatter: Table.api.formatter.status},
48 - {field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'},  
49 - {field: 'user.avatar', title: __('User.avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image},  
50 {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} 50 {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
51 ] 51 ]
52 ] 52 ]
@@ -25,14 +25,15 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin @@ -25,14 +25,15 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
25 [ 25 [
26 {checkbox: true}, 26 {checkbox: true},
27 {field: 'id', title: __('Id'), sortable: true}, 27 {field: 'id', title: __('Id'), sortable: true},
28 - {field: 'group.name', title: __('Group')},  
29 - {field: 'username', title: __('Username'), operate: 'LIKE'}, 28 + {field: 'user_type', title: __('User_type'), formatter: Table.api.formatter.status, searchList: {1: __('User_type 1'), 2: __('User_type 2')}},
  29 + // {field: 'group.name', title: __('Group')},
  30 + // {field: 'username', title: __('Username'), operate: 'LIKE'},
30 {field: 'nickname', title: __('Nickname'), operate: 'LIKE'}, 31 {field: 'nickname', title: __('Nickname'), operate: 'LIKE'},
31 - {field: 'email', title: __('Email'), operate: 'LIKE'}, 32 + // {field: 'email', title: __('Email'), operate: 'LIKE'},
32 {field: 'mobile', title: __('Mobile'), operate: 'LIKE'}, 33 {field: 'mobile', title: __('Mobile'), operate: 'LIKE'},
33 {field: 'avatar', title: __('Avatar'), events: Table.api.events.image, formatter: Table.api.formatter.image, operate: false}, 34 {field: 'avatar', title: __('Avatar'), events: Table.api.events.image, formatter: Table.api.formatter.image, operate: false},
34 - {field: 'level', title: __('Level'), operate: 'BETWEEN', sortable: true},  
35 - {field: 'gender', title: __('Gender'), visible: false, searchList: {1: __('Male'), 0: __('Female')}}, 35 + // {field: 'level', title: __('Level'), operate: 'BETWEEN', sortable: true},
  36 + // {field: 'gender', title: __('Gender'), visible: false, searchList: {1: __('Male'), 0: __('Female')}},
36 {field: 'score', title: __('Score'), operate: 'BETWEEN', sortable: true}, 37 {field: 'score', title: __('Score'), operate: 'BETWEEN', sortable: true},
37 {field: 'successions', title: __('Successions'), visible: false, operate: 'BETWEEN', sortable: true}, 38 {field: 'successions', title: __('Successions'), visible: false, operate: 'BETWEEN', sortable: true},
38 {field: 'maxsuccessions', title: __('Maxsuccessions'), visible: false, operate: 'BETWEEN', sortable: true}, 39 {field: 'maxsuccessions', title: __('Maxsuccessions'), visible: false, operate: 'BETWEEN', sortable: true},
@@ -40,6 +41,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin @@ -40,6 +41,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
40 {field: 'loginip', title: __('Loginip'), formatter: Table.api.formatter.search}, 41 {field: 'loginip', title: __('Loginip'), formatter: Table.api.formatter.search},
41 {field: 'jointime', title: __('Jointime'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true}, 42 {field: 'jointime', title: __('Jointime'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true},
42 {field: 'joinip', title: __('Joinip'), formatter: Table.api.formatter.search}, 43 {field: 'joinip', title: __('Joinip'), formatter: Table.api.formatter.search},
  44 + {field: 'rider', title: __('Rider'), formatter: Table.api.formatter.status, searchList: {0: __('Rider 0'), 1: __('Rider 1'), 2: __('Rider 2'), 3: __('Rider 3')}},
43 {field: 'status', title: __('Status'), formatter: Table.api.formatter.status, searchList: {normal: __('Normal'), hidden: __('Hidden')}}, 45 {field: 'status', title: __('Status'), formatter: Table.api.formatter.status, searchList: {normal: __('Normal'), hidden: __('Hidden')}},
44 {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} 46 {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
45 ] 47 ]