正在显示
18 个修改的文件
包含
428 行增加
和
8 行删除
@@ -23,6 +23,7 @@ class Litestoregoods extends Backend | @@ -23,6 +23,7 @@ class Litestoregoods extends Backend | ||
23 | protected $model = null; | 23 | protected $model = null; |
24 | protected $dataLimit = true; | 24 | protected $dataLimit = true; |
25 | protected $dataLimitField = 'store_id'; | 25 | protected $dataLimitField = 'store_id'; |
26 | + protected $multiFields = 'is_recommend'; | ||
26 | 27 | ||
27 | public function _initialize() | 28 | public function _initialize() |
28 | { | 29 | { |
@@ -34,6 +35,7 @@ class Litestoregoods extends Backend | @@ -34,6 +35,7 @@ class Litestoregoods extends Backend | ||
34 | $this->view->assign("specTypeList", $this->model->getSpecTypeList()); | 35 | $this->view->assign("specTypeList", $this->model->getSpecTypeList()); |
35 | $this->view->assign("deductStockTypeList", $this->model->getDeductStockTypeList()); | 36 | $this->view->assign("deductStockTypeList", $this->model->getDeductStockTypeList()); |
36 | $this->view->assign("goodsStatusList", $this->model->getGoodsStatusList()); | 37 | $this->view->assign("goodsStatusList", $this->model->getGoodsStatusList()); |
38 | + $this->view->assign("isRecommendList", $this->model->getIsRecommendList()); | ||
37 | $this->view->assign("isDeleteList", $this->model->getIsDeleteList()); | 39 | $this->view->assign("isDeleteList", $this->model->getIsDeleteList()); |
38 | 40 | ||
39 | $this->view->assign("spec_attr", ''); | 41 | $this->view->assign("spec_attr", ''); |
1 | +<?php | ||
2 | + | ||
3 | +namespace app\admin\controller\store; | ||
4 | + | ||
5 | +use app\common\controller\Backend; | ||
6 | + | ||
7 | +/** | ||
8 | + * 开通新社区申请管理 | ||
9 | + * | ||
10 | + * @icon fa fa-circle-o | ||
11 | + */ | ||
12 | +class StoreApply extends Backend | ||
13 | +{ | ||
14 | + | ||
15 | + /** | ||
16 | + * StoreApply模型对象 | ||
17 | + * @var \app\admin\model\store\StoreApply | ||
18 | + */ | ||
19 | + protected $model = null; | ||
20 | + | ||
21 | + public function _initialize() | ||
22 | + { | ||
23 | + parent::_initialize(); | ||
24 | + $this->model = new \app\admin\model\store\StoreApply; | ||
25 | + | ||
26 | + } | ||
27 | + | ||
28 | + /** | ||
29 | + * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法 | ||
30 | + * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑 | ||
31 | + * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改 | ||
32 | + */ | ||
33 | + | ||
34 | + | ||
35 | + /** | ||
36 | + * 查看 | ||
37 | + */ | ||
38 | + public function index() | ||
39 | + { | ||
40 | + //当前是否为关联查询 | ||
41 | + $this->relationSearch = true; | ||
42 | + //设置过滤方法 | ||
43 | + $this->request->filter(['strip_tags', 'trim']); | ||
44 | + if ($this->request->isAjax()) | ||
45 | + { | ||
46 | + //如果发送的来源是Selectpage,则转发到Selectpage | ||
47 | + if ($this->request->request('keyField')) | ||
48 | + { | ||
49 | + return $this->selectpage(); | ||
50 | + } | ||
51 | + list($where, $sort, $order, $offset, $limit) = $this->buildparams(); | ||
52 | + $total = $this->model | ||
53 | + ->with(['user']) | ||
54 | + ->where($where) | ||
55 | + ->order($sort, $order) | ||
56 | + ->count(); | ||
57 | + | ||
58 | + $list = $this->model | ||
59 | + ->with(['user']) | ||
60 | + ->where($where) | ||
61 | + ->order($sort, $order) | ||
62 | + ->limit($offset, $limit) | ||
63 | + ->select(); | ||
64 | + | ||
65 | + foreach ($list as $row) { | ||
66 | + | ||
67 | + $row->getRelation('user')->visible(['nickname']); | ||
68 | + } | ||
69 | + $list = collection($list)->toArray(); | ||
70 | + $result = array("total" => $total, "rows" => $list); | ||
71 | + | ||
72 | + return json($result); | ||
73 | + } | ||
74 | + return $this->view->fetch(); | ||
75 | + } | ||
76 | +} |
@@ -21,6 +21,9 @@ return [ | @@ -21,6 +21,9 @@ return [ | ||
21 | 'Goods_status' => '商品状态', | 21 | 'Goods_status' => '商品状态', |
22 | 'Goods_status 10' => '上架', | 22 | 'Goods_status 10' => '上架', |
23 | 'Goods_status 20' => '下架', | 23 | 'Goods_status 20' => '下架', |
24 | + 'Is_recommend' => '是否首页推荐', | ||
25 | + 'Is_recommend 0' => '否', | ||
26 | + 'Is_recommend 1' => '是', | ||
24 | 'Is_delete' => '是否删除', | 27 | 'Is_delete' => '是否删除', |
25 | 'Is_delete 0' => '未删除', | 28 | 'Is_delete 0' => '未删除', |
26 | 'Is_delete 1' => '已删除', | 29 | 'Is_delete 1' => '已删除', |
@@ -21,6 +21,7 @@ class Litestoregoods extends Model | @@ -21,6 +21,7 @@ class Litestoregoods extends Model | ||
21 | 'spec_type_text', | 21 | 'spec_type_text', |
22 | 'deduct_stock_type_text', | 22 | 'deduct_stock_type_text', |
23 | 'goods_status_text', | 23 | 'goods_status_text', |
24 | + 'is_recommend_text', | ||
24 | 'is_delete_text' | 25 | 'is_delete_text' |
25 | ]; | 26 | ]; |
26 | 27 | ||
@@ -47,7 +48,12 @@ class Litestoregoods extends Model | @@ -47,7 +48,12 @@ class Litestoregoods extends Model | ||
47 | public function getGoodsStatusList() | 48 | public function getGoodsStatusList() |
48 | { | 49 | { |
49 | return ['10' => __('Goods_status 10'),'20' => __('Goods_status 20')]; | 50 | return ['10' => __('Goods_status 10'),'20' => __('Goods_status 20')]; |
50 | - } | 51 | + } |
52 | + | ||
53 | + public function getIsRecommendList() | ||
54 | + { | ||
55 | + return ['0' => __('Is_recommend 0'),'1' => __('Is_recommend 1')]; | ||
56 | + } | ||
51 | 57 | ||
52 | public function getIsDeleteList() | 58 | public function getIsDeleteList() |
53 | { | 59 | { |
@@ -86,6 +92,13 @@ class Litestoregoods extends Model | @@ -86,6 +92,13 @@ class Litestoregoods extends Model | ||
86 | return isset($list[$value]) ? $list[$value] : ''; | 92 | return isset($list[$value]) ? $list[$value] : ''; |
87 | } | 93 | } |
88 | 94 | ||
95 | + public function getIsRecommendTextAttr($value, $data) | ||
96 | + { | ||
97 | + $value = $value ? $value : (isset($data['is_recommend']) ? $data['is_recommend'] : ''); | ||
98 | + $list = $this->getIsRecommendList(); | ||
99 | + return isset($list[$value]) ? $list[$value] : ''; | ||
100 | + } | ||
101 | + | ||
89 | public function category() | 102 | public function category() |
90 | { | 103 | { |
91 | return $this->belongsTo('litestorecategory', 'category_id', 'id', [], 'LEFT')->setEagerlyType(0); | 104 | return $this->belongsTo('litestorecategory', 'category_id', 'id', [], 'LEFT')->setEagerlyType(0); |
application/admin/model/store/StoreApply.php
0 → 100644
1 | +<?php | ||
2 | + | ||
3 | +namespace app\admin\model\store; | ||
4 | + | ||
5 | +use think\Model; | ||
6 | + | ||
7 | + | ||
8 | +class StoreApply extends Model | ||
9 | +{ | ||
10 | + | ||
11 | + | ||
12 | + | ||
13 | + | ||
14 | + | ||
15 | + // 表名 | ||
16 | + protected $name = 'store_apply'; | ||
17 | + | ||
18 | + // 自动写入时间戳字段 | ||
19 | + protected $autoWriteTimestamp = 'int'; | ||
20 | + | ||
21 | + // 定义时间戳字段名 | ||
22 | + protected $createTime = 'createtime'; | ||
23 | + protected $updateTime = 'updatetime'; | ||
24 | + protected $deleteTime = false; | ||
25 | + | ||
26 | + // 追加属性 | ||
27 | + protected $append = [ | ||
28 | + | ||
29 | + ]; | ||
30 | + | ||
31 | + | ||
32 | + | ||
33 | + | ||
34 | + | ||
35 | + | ||
36 | + | ||
37 | + | ||
38 | + | ||
39 | + | ||
40 | + public function user() | ||
41 | + { | ||
42 | + return $this->belongsTo('app\admin\model\User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0); | ||
43 | + } | ||
44 | +} |
1 | +<?php | ||
2 | + | ||
3 | +namespace app\admin\validate\store; | ||
4 | + | ||
5 | +use think\Validate; | ||
6 | + | ||
7 | +class StoreApply extends Validate | ||
8 | +{ | ||
9 | + /** | ||
10 | + * 验证规则 | ||
11 | + */ | ||
12 | + protected $rule = [ | ||
13 | + ]; | ||
14 | + /** | ||
15 | + * 提示消息 | ||
16 | + */ | ||
17 | + protected $message = [ | ||
18 | + ]; | ||
19 | + /** | ||
20 | + * 验证场景 | ||
21 | + */ | ||
22 | + protected $scene = [ | ||
23 | + 'add' => [], | ||
24 | + 'edit' => [], | ||
25 | + ]; | ||
26 | + | ||
27 | +} |
@@ -216,6 +216,18 @@ | @@ -216,6 +216,18 @@ | ||
216 | </div> | 216 | </div> |
217 | </div> | 217 | </div> |
218 | <div class="form-group"> | 218 | <div class="form-group"> |
219 | + <label class="control-label col-xs-12 col-sm-2">{:__('Is_recommend')}:</label> | ||
220 | + <div class="col-xs-12 col-sm-8"> | ||
221 | + | ||
222 | + <select id="c-is_recommend" data-rule="required" class="form-control selectpicker" name="row[is_recommend]"> | ||
223 | + {foreach name="isDeleteList" item="vo"} | ||
224 | + <option value="{$key}" {in name="key" value="0"}selected{/in}>{$vo}</option> | ||
225 | + {/foreach} | ||
226 | + </select> | ||
227 | + | ||
228 | + </div> | ||
229 | + </div> | ||
230 | + <div class="form-group"> | ||
219 | <label class="control-label col-xs-12 col-sm-2">{:__('Is_delete')}:</label> | 231 | <label class="control-label col-xs-12 col-sm-2">{:__('Is_delete')}:</label> |
220 | <div class="col-xs-12 col-sm-8"> | 232 | <div class="col-xs-12 col-sm-8"> |
221 | 233 |
@@ -213,6 +213,18 @@ | @@ -213,6 +213,18 @@ | ||
213 | </div> | 213 | </div> |
214 | </div> | 214 | </div> |
215 | <div class="form-group"> | 215 | <div class="form-group"> |
216 | + <label class="control-label col-xs-12 col-sm-2">{:__('Is_recommend')}:</label> | ||
217 | + <div class="col-xs-12 col-sm-8"> | ||
218 | + | ||
219 | + <select id="c-is_recommend" data-rule="required" class="form-control selectpicker" name="row[is_recommend]"> | ||
220 | + {foreach name="isRecommendList" item="vo"} | ||
221 | + <option value="{$key}" {in name="key" value="$row.is_recommend"}selected{/in}>{$vo}</option> | ||
222 | + {/foreach} | ||
223 | + </select> | ||
224 | + | ||
225 | + </div> | ||
226 | + </div> | ||
227 | + <div class="form-group"> | ||
216 | <label class="control-label col-xs-12 col-sm-2">{:__('Is_delete')}:</label> | 228 | <label class="control-label col-xs-12 col-sm-2">{:__('Is_delete')}:</label> |
217 | <div class="col-xs-12 col-sm-8"> | 229 | <div class="col-xs-12 col-sm-8"> |
218 | 230 |
1 | +<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action=""> | ||
2 | + | ||
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" data-source="user/user/index" data-field="nickname" class="form-control selectpage" name="row[user_id]" type="text" value=""> | ||
7 | + </div> | ||
8 | + </div> | ||
9 | + <div class="form-group"> | ||
10 | + <label class="control-label col-xs-12 col-sm-2">{:__('Store_name')}:</label> | ||
11 | + <div class="col-xs-12 col-sm-8"> | ||
12 | + <input id="c-store_name" data-rule="required" class="form-control" name="row[store_name]" type="text" value="''"> | ||
13 | + </div> | ||
14 | + </div> | ||
15 | + <div class="form-group"> | ||
16 | + <label class="control-label col-xs-12 col-sm-2">{:__('Province')}:</label> | ||
17 | + <div class="col-xs-12 col-sm-8"> | ||
18 | + <input id="c-province" data-rule="required" class="form-control" name="row[province]" type="text"> | ||
19 | + </div> | ||
20 | + </div> | ||
21 | + <div class="form-group"> | ||
22 | + <label class="control-label col-xs-12 col-sm-2">{:__('City')}:</label> | ||
23 | + <div class="col-xs-12 col-sm-8"> | ||
24 | + <div class='control-relative'><input id="c-city" data-rule="required" class="form-control" data-toggle="city-picker" name="row[city]" type="text" value="''"></div> | ||
25 | + </div> | ||
26 | + </div> | ||
27 | + <div class="form-group"> | ||
28 | + <label class="control-label col-xs-12 col-sm-2">{:__('Region')}:</label> | ||
29 | + <div class="col-xs-12 col-sm-8"> | ||
30 | + <input id="c-region" data-rule="required" class="form-control" name="row[region]" type="text" value="''"> | ||
31 | + </div> | ||
32 | + </div> | ||
33 | + <div class="form-group"> | ||
34 | + <label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label> | ||
35 | + <div class="col-xs-12 col-sm-8"> | ||
36 | + <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="''"> | ||
37 | + </div> | ||
38 | + </div> | ||
39 | + <div class="form-group"> | ||
40 | + <label class="control-label col-xs-12 col-sm-2">{:__('Mobile')}:</label> | ||
41 | + <div class="col-xs-12 col-sm-8"> | ||
42 | + <input id="c-mobile" data-rule="required" class="form-control" name="row[mobile]" type="text" value="''"> | ||
43 | + </div> | ||
44 | + </div> | ||
45 | + <div class="form-group layer-footer"> | ||
46 | + <label class="control-label col-xs-12 col-sm-2"></label> | ||
47 | + <div class="col-xs-12 col-sm-8"> | ||
48 | + <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button> | ||
49 | + <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button> | ||
50 | + </div> | ||
51 | + </div> | ||
52 | +</form> |
1 | +<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action=""> | ||
2 | + | ||
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" 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">{:__('Store_name')}:</label> | ||
11 | + <div class="col-xs-12 col-sm-8"> | ||
12 | + <input id="c-store_name" data-rule="required" class="form-control" name="row[store_name]" type="text" value="{$row.store_name|htmlentities}"> | ||
13 | + </div> | ||
14 | + </div> | ||
15 | + <div class="form-group"> | ||
16 | + <label class="control-label col-xs-12 col-sm-2">{:__('Province')}:</label> | ||
17 | + <div class="col-xs-12 col-sm-8"> | ||
18 | + <input id="c-province" data-rule="required" class="form-control" name="row[province]" type="text" value="{$row.province|htmlentities}"> | ||
19 | + </div> | ||
20 | + </div> | ||
21 | + <div class="form-group"> | ||
22 | + <label class="control-label col-xs-12 col-sm-2">{:__('City')}:</label> | ||
23 | + <div class="col-xs-12 col-sm-8"> | ||
24 | + <div class='control-relative'><input id="c-city" data-rule="required" class="form-control" data-toggle="city-picker" name="row[city]" type="text" value="{$row.city|htmlentities}"></div> | ||
25 | + </div> | ||
26 | + </div> | ||
27 | + <div class="form-group"> | ||
28 | + <label class="control-label col-xs-12 col-sm-2">{:__('Region')}:</label> | ||
29 | + <div class="col-xs-12 col-sm-8"> | ||
30 | + <input id="c-region" data-rule="required" class="form-control" name="row[region]" type="text" value="{$row.region|htmlentities}"> | ||
31 | + </div> | ||
32 | + </div> | ||
33 | + <div class="form-group"> | ||
34 | + <label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label> | ||
35 | + <div class="col-xs-12 col-sm-8"> | ||
36 | + <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="{$row.name|htmlentities}"> | ||
37 | + </div> | ||
38 | + </div> | ||
39 | + <div class="form-group"> | ||
40 | + <label class="control-label col-xs-12 col-sm-2">{:__('Mobile')}:</label> | ||
41 | + <div class="col-xs-12 col-sm-8"> | ||
42 | + <input id="c-mobile" data-rule="required" class="form-control" name="row[mobile]" type="text" value="{$row.mobile|htmlentities}"> | ||
43 | + </div> | ||
44 | + </div> | ||
45 | + <div class="form-group layer-footer"> | ||
46 | + <label class="control-label col-xs-12 col-sm-2"></label> | ||
47 | + <div class="col-xs-12 col-sm-8"> | ||
48 | + <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button> | ||
49 | + <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button> | ||
50 | + </div> | ||
51 | + </div> | ||
52 | +</form> |
1 | +<div class="panel panel-default panel-intro"> | ||
2 | + {:build_heading()} | ||
3 | + | ||
4 | + <div class="panel-body"> | ||
5 | + <div id="myTabContent" class="tab-content"> | ||
6 | + <div class="tab-pane fade active in" id="one"> | ||
7 | + <div class="widget-body no-padding"> | ||
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> | ||
10 | +<!-- <a href="javascript:;" class="btn btn-success btn-add {:$auth->check('store/store_apply/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('store/store_apply/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('store/store_apply/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a> | ||
13 | +<!-- <a href="javascript:;" class="btn btn-danger btn-import {:$auth->check('store/store_apply/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 | + | ||
15 | +<!-- <div class="dropdown btn-group {:$auth->check('store/store_apply/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 | + | ||
23 | + | ||
24 | + </div> | ||
25 | + <table id="table" class="table table-striped table-bordered table-hover table-nowrap" | ||
26 | + data-operate-edit="{:$auth->check('store/store_apply/edit')}" | ||
27 | + data-operate-del="{:$auth->check('store/store_apply/del')}" | ||
28 | + width="100%"> | ||
29 | + </table> | ||
30 | + </div> | ||
31 | + </div> | ||
32 | + | ||
33 | + </div> | ||
34 | + </div> | ||
35 | +</div> |
@@ -244,9 +244,8 @@ class House extends Api | @@ -244,9 +244,8 @@ class House extends Api | ||
244 | */ | 244 | */ |
245 | public function goods() | 245 | public function goods() |
246 | { | 246 | { |
247 | - $goods_ids = Db::name('config_goods')->where('id',1)->value('goods_ids'); | ||
248 | $list = Db::name('litestore_goods') | 247 | $list = Db::name('litestore_goods') |
249 | - ->where('goods_id','in',$goods_ids) | 248 | + ->where('is_recommend',1) |
250 | ->field('goods_id,goods_name,images') | 249 | ->field('goods_id,goods_name,images') |
251 | ->select(); | 250 | ->select(); |
252 | foreach($list as &$v){ | 251 | foreach($list as &$v){ |
@@ -16,6 +16,7 @@ use app\api\model\StoreOrder; | @@ -16,6 +16,7 @@ use app\api\model\StoreOrder; | ||
16 | use app\api\model\UserScoreLog; | 16 | use app\api\model\UserScoreLog; |
17 | use app\api\validate\StoreValidate; | 17 | use app\api\validate\StoreValidate; |
18 | use app\common\controller\Api; | 18 | use app\common\controller\Api; |
19 | +use app\common\library\Sms as Smslib; | ||
19 | use EasyWeChat\Foundation\Application; | 20 | use EasyWeChat\Foundation\Application; |
20 | use EasyWeChat\Payment\Order; | 21 | use EasyWeChat\Payment\Order; |
21 | use think\Db; | 22 | use think\Db; |
@@ -193,6 +194,7 @@ class Store extends Api | @@ -193,6 +194,7 @@ class Store extends Api | ||
193 | * @ApiParams (name="industry_id", type="string", required=true, description="行业/关键词") | 194 | * @ApiParams (name="industry_id", type="string", required=true, description="行业/关键词") |
194 | * @ApiParams (name="name", type="string", required=true, description="联系人姓名") | 195 | * @ApiParams (name="name", type="string", required=true, description="联系人姓名") |
195 | * @ApiParams (name="mobile", type="string", required=true, description="联系人手机号") | 196 | * @ApiParams (name="mobile", type="string", required=true, description="联系人手机号") |
197 | + * @ApiParams (name="code", type="string", required=true, description="验证码") | ||
196 | * @ApiParams (name="license", type="string", required=true, description="营业执照") | 198 | * @ApiParams (name="license", type="string", required=true, description="营业执照") |
197 | * @ApiReturnParams (name="code", type="integer", required=true, sample="0") | 199 | * @ApiReturnParams (name="code", type="integer", required=true, sample="0") |
198 | * @ApiReturnParams (name="msg", type="string", required=true, sample="返回成功") | 200 | * @ApiReturnParams (name="msg", type="string", required=true, sample="返回成功") |
@@ -220,6 +222,15 @@ class Store extends Api | @@ -220,6 +222,15 @@ class Store extends Api | ||
220 | $this->error('商家申请已通过'); | 222 | $this->error('商家申请已通过'); |
221 | } | 223 | } |
222 | } | 224 | } |
225 | + // 验证码验证 | ||
226 | + $mobile = $param['mobile']; | ||
227 | + $captcha = $param['code']; | ||
228 | + $event = 'test'; | ||
229 | + $ret = Smslib::check($mobile, $captcha, $event); | ||
230 | + if (!$ret) { | ||
231 | + $this->error(__('验证码不正确')); | ||
232 | + } | ||
233 | + unset($param['code']); | ||
223 | $order_sn = $param['order_sn'] = get_order_sn(); | 234 | $order_sn = $param['order_sn'] = get_order_sn(); |
224 | // 获取配置 | 235 | // 获取配置 |
225 | $app = new Application(ConfigService::load()); | 236 | $app = new Application(ConfigService::load()); |
@@ -282,6 +293,7 @@ class Store extends Api | @@ -282,6 +293,7 @@ class Store extends Api | ||
282 | * @ApiParams (name="region", type="string", required=true, description="区") | 293 | * @ApiParams (name="region", type="string", required=true, description="区") |
283 | * @ApiParams (name="name", type="string", required=true, description="联系人姓名") | 294 | * @ApiParams (name="name", type="string", required=true, description="联系人姓名") |
284 | * @ApiParams (name="mobile", type="string", required=true, description="联系人手机号") | 295 | * @ApiParams (name="mobile", type="string", required=true, description="联系人手机号") |
296 | + * @ApiParams (name="code", type="string", required=true, description="验证码") | ||
285 | * @ApiReturnParams (name="code", type="integer", required=true, sample="0") | 297 | * @ApiReturnParams (name="code", type="integer", required=true, sample="0") |
286 | * @ApiReturnParams (name="msg", type="string", required=true, sample="返回成功") | 298 | * @ApiReturnParams (name="msg", type="string", required=true, sample="返回成功") |
287 | * @ApiReturn ({ | 299 | * @ApiReturn ({ |
@@ -292,6 +304,15 @@ class Store extends Api | @@ -292,6 +304,15 @@ class Store extends Api | ||
292 | public function store_apply() | 304 | public function store_apply() |
293 | { | 305 | { |
294 | $param = (new StoreValidate())->goCheck('store_apply'); | 306 | $param = (new StoreValidate())->goCheck('store_apply'); |
307 | + // 验证码验证 | ||
308 | + $mobile = $param['mobile']; | ||
309 | + $captcha = $param['code']; | ||
310 | + $event = 'test'; | ||
311 | + $ret = Smslib::check($mobile, $captcha, $event); | ||
312 | + if (!$ret) { | ||
313 | + $this->error(__('验证码不正确'),$ret); | ||
314 | + } | ||
315 | + unset($param['code']); | ||
295 | Db::startTrans(); | 316 | Db::startTrans(); |
296 | $result = false; | 317 | $result = false; |
297 | try{ | 318 | try{ |
@@ -29,8 +29,8 @@ class StoreValidate extends BaseValidate | @@ -29,8 +29,8 @@ class StoreValidate extends BaseValidate | ||
29 | 29 | ||
30 | protected $scene = [ | 30 | protected $scene = [ |
31 | 'common' => ['page'], // 公共分页验证 | 31 | 'common' => ['page'], // 公共分页验证 |
32 | - 'store_add' => ['store_name','house_ids','industry_id','name','mobile','license'], // 店铺申请 | ||
33 | - 'store_apply' => ['store_name','province','city','region','name','mobile'], // 开通社区提交 | 32 | + 'store_add' => ['store_name','house_ids','industry_id','name','mobile','code','license'], // 店铺申请 |
33 | + 'store_apply' => ['store_name','province','city','region','name','mobile','code'], // 开通社区提交 | ||
34 | 'store_report' => ['content'], // 举报建议提交 | 34 | 'store_report' => ['content'], // 举报建议提交 |
35 | 'store_edit' => ['store_icon','store_name','mobile','province','city','region','images'], // 店铺信息修改 | 35 | 'store_edit' => ['store_icon','store_name','mobile','province','city','region','images'], // 店铺信息修改 |
36 | 'store_inform_add' => ['content','images','house_ids','type'], // 发布信息 | 36 | 'store_inform_add' => ['content','images','house_ids','type'], // 发布信息 |
@@ -110,11 +110,10 @@ class Sms | @@ -110,11 +110,10 @@ class Sms | ||
110 | } else { | 110 | } else { |
111 | // 过期则清空该手机验证码 | 111 | // 过期则清空该手机验证码 |
112 | self::flush($mobile, $event); | 112 | self::flush($mobile, $event); |
113 | - return 2; | 113 | + return false; |
114 | } | 114 | } |
115 | } else { | 115 | } else { |
116 | - return \app\common\model\Sms::where(['mobile' => $mobile, 'event' => $event]) | ||
117 | - ->order('id', 'DESC')->buildSql(); | 116 | + return false; |
118 | } | 117 | } |
119 | } | 118 | } |
120 | 119 |
@@ -38,6 +38,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form','template','litestoreg | @@ -38,6 +38,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form','template','litestoreg | ||
38 | {field: 'goods_sort', title: __('Goods_sort')}, | 38 | {field: 'goods_sort', title: __('Goods_sort')}, |
39 | // {field: 'delivery_id', title: __('Delivery_id')}, | 39 | // {field: 'delivery_id', title: __('Delivery_id')}, |
40 | {field: 'goods_status', title: __('Goods_status'), searchList: {"10":__('Goods_status 10'),"20":__('Goods_status 20')}, formatter: Table.api.formatter.status}, | 40 | {field: 'goods_status', title: __('Goods_status'), searchList: {"10":__('Goods_status 10'),"20":__('Goods_status 20')}, formatter: Table.api.formatter.status}, |
41 | + {field: 'is_recommend', title: __('Is_recommend'),table:table, formatter: Table.api.formatter.toggle, yes: 1, no: 0, searchList: {0:__('Is_recommend 0'),1:__('Is_recommend 1')}}, | ||
41 | {field: 'is_delete', title: __('Is_delete'), searchList: {"0":__('Is_delete 0'),"1":__('Is_delete 1')}, formatter: Table.api.formatter.normal}, | 42 | {field: 'is_delete', title: __('Is_delete'), searchList: {"0":__('Is_delete 0'),"1":__('Is_delete 1')}, formatter: Table.api.formatter.normal}, |
42 | {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime}, | 43 | {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime}, |
43 | {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime}, | 44 | {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime}, |
1 | +define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { | ||
2 | + | ||
3 | + var Controller = { | ||
4 | + index: function () { | ||
5 | + // 初始化表格参数配置 | ||
6 | + Table.api.init({ | ||
7 | + extend: { | ||
8 | + index_url: 'store/store_apply/index' + location.search, | ||
9 | + add_url: 'store/store_apply/add', | ||
10 | + edit_url: 'store/store_apply/edit', | ||
11 | + del_url: 'store/store_apply/del', | ||
12 | + multi_url: 'store/store_apply/multi', | ||
13 | + table: 'store_apply', | ||
14 | + } | ||
15 | + }); | ||
16 | + | ||
17 | + var table = $("#table"); | ||
18 | + | ||
19 | + // 初始化表格 | ||
20 | + table.bootstrapTable({ | ||
21 | + url: $.fn.bootstrapTable.defaults.extend.index_url, | ||
22 | + pk: 'id', | ||
23 | + sortName: 'id', | ||
24 | + columns: [ | ||
25 | + [ | ||
26 | + {checkbox: true}, | ||
27 | + {field: 'id', title: __('Id')}, | ||
28 | + {field: 'user_id', title: __('User_id')}, | ||
29 | + {field: 'store_name', title: __('Store_name')}, | ||
30 | + {field: 'province', title: __('Province')}, | ||
31 | + {field: 'city', title: __('City')}, | ||
32 | + {field: 'region', title: __('Region')}, | ||
33 | + {field: 'name', title: __('Name')}, | ||
34 | + {field: 'mobile', title: __('Mobile')}, | ||
35 | + {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime}, | ||
36 | + {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime}, | ||
37 | + {field: 'user.nickname', title: __('User.nickname')}, | ||
38 | + {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} | ||
39 | + ] | ||
40 | + ] | ||
41 | + }); | ||
42 | + | ||
43 | + // 为表格绑定事件 | ||
44 | + Table.api.bindevent(table); | ||
45 | + }, | ||
46 | + add: function () { | ||
47 | + Controller.api.bindevent(); | ||
48 | + }, | ||
49 | + edit: function () { | ||
50 | + Controller.api.bindevent(); | ||
51 | + }, | ||
52 | + api: { | ||
53 | + bindevent: function () { | ||
54 | + Form.api.bindevent($("form[role=form]")); | ||
55 | + } | ||
56 | + } | ||
57 | + }; | ||
58 | + return Controller; | ||
59 | +}); |
-
请 注册 或 登录 后发表评论