正在显示
11 个修改的文件
包含
76 行增加
和
26 行删除
| @@ -60,7 +60,7 @@ class Activity extends Backend | @@ -60,7 +60,7 @@ class Activity extends Backend | ||
| 60 | ->paginate($limit); | 60 | ->paginate($limit); |
| 61 | 61 | ||
| 62 | foreach ($list as $row) { | 62 | foreach ($list as $row) { |
| 63 | - $row->visible(['id','title','verification_store_id','verification_coupon_ids','image','createtime','updatetime','closetime','price','content','phone']); | 63 | + $row->visible(['id','title','verification_store_id','verification_coupon_ids','poster','image','createtime','updatetime','closetime','price','content','phone']); |
| 64 | $row->visible(['store']); | 64 | $row->visible(['store']); |
| 65 | $row->getRelation('store')->visible(['name']); | 65 | $row->getRelation('store')->visible(['name']); |
| 66 | $row->visible(['coupon']); | 66 | $row->visible(['coupon']); |
| @@ -2,6 +2,7 @@ | @@ -2,6 +2,7 @@ | ||
| 2 | 2 | ||
| 3 | namespace app\admin\controller\verification; | 3 | namespace app\admin\controller\verification; |
| 4 | 4 | ||
| 5 | +use app\admin\controller\Index; | ||
| 5 | use app\common\controller\Backend; | 6 | use app\common\controller\Backend; |
| 6 | use think\Db; | 7 | use think\Db; |
| 7 | use think\exception\PDOException; | 8 | use think\exception\PDOException; |
| @@ -65,7 +66,11 @@ class Store extends Backend | @@ -65,7 +66,11 @@ class Store extends Backend | ||
| 65 | $validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.add' : $name) : $this->modelValidate; | 66 | $validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.add' : $name) : $this->modelValidate; |
| 66 | $this->model->validateFailException()->validate($validate); | 67 | $this->model->validateFailException()->validate($validate); |
| 67 | } | 68 | } |
| 68 | - $result = $this->model->allowField(true)->save($params); | 69 | + $result = $this->model->allowField(true)->insertGetId($params); |
| 70 | + $index=new Index(); | ||
| 71 | + $agent_image=$index->build($result); | ||
| 72 | + $result = Db::name('verification_store')->where('id','=',$result)->update(['agent_image'=>$agent_image]); | ||
| 73 | + | ||
| 69 | Db::commit(); | 74 | Db::commit(); |
| 70 | } catch (ValidateException|PDOException|Exception $e) { | 75 | } catch (ValidateException|PDOException|Exception $e) { |
| 71 | Db::rollback(); | 76 | Db::rollback(); |
| @@ -10,6 +10,7 @@ return [ | @@ -10,6 +10,7 @@ return [ | ||
| 10 | 'Closetime' => '截止时间', | 10 | 'Closetime' => '截止时间', |
| 11 | 'Price' => '价格', | 11 | 'Price' => '价格', |
| 12 | 'Image' => '封面图', | 12 | 'Image' => '封面图', |
| 13 | + 'Poster' => '海报', | ||
| 13 | 'Phone' => '联系电话', | 14 | 'Phone' => '联系电话', |
| 14 | 'Store.name' => '门店名称', | 15 | 'Store.name' => '门店名称', |
| 15 | 'Coupon.name' => '卡卷名称' | 16 | 'Coupon.name' => '卡卷名称' |
| @@ -27,6 +27,21 @@ | @@ -27,6 +27,21 @@ | ||
| 27 | <ul class="row list-inline faupload-preview" id="p-image"></ul> | 27 | <ul class="row list-inline faupload-preview" id="p-image"></ul> |
| 28 | </div> | 28 | </div> |
| 29 | </div> | 29 | </div> |
| 30 | + | ||
| 31 | + <div class="form-group"> | ||
| 32 | + <label class="control-label col-xs-12 col-sm-2">{:__('Poster')}:</label> | ||
| 33 | + <div class="col-xs-12 col-sm-8"> | ||
| 34 | + <div class="input-group"> | ||
| 35 | + <input id="c-poster" class="form-control" size="50" name="row[poster]" type="text"> | ||
| 36 | + <div class="input-group-addon no-border no-padding"> | ||
| 37 | + <span><button type="button" id="faupload-poster" class="btn btn-danger faupload" data-input-id="c-poster" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-poster"><i class="fa fa-upload"></i> {:__('Upload')}</button></span> | ||
| 38 | + <span><button type="button" id="fachoose-poster" class="btn btn-primary fachoose" data-input-id="c-poster" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span> | ||
| 39 | + </div> | ||
| 40 | + <span class="msg-box n-right" for="c-poster"></span> | ||
| 41 | + </div> | ||
| 42 | + <ul class="row list-inline faupload-preview" id="p-poster"></ul> | ||
| 43 | + </div> | ||
| 44 | + </div> | ||
| 30 | <div class="form-group"> | 45 | <div class="form-group"> |
| 31 | <label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label> | 46 | <label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label> |
| 32 | <div class="col-xs-12 col-sm-8"> | 47 | <div class="col-xs-12 col-sm-8"> |
| @@ -45,12 +60,7 @@ | @@ -45,12 +60,7 @@ | ||
| 45 | <input id="c-price" class="form-control" name="row[price]" type="number"> | 60 | <input id="c-price" class="form-control" name="row[price]" type="number"> |
| 46 | </div> | 61 | </div> |
| 47 | </div> | 62 | </div> |
| 48 | - <div class="form-group"> | ||
| 49 | - <label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label> | ||
| 50 | - <div class="col-xs-12 col-sm-8"> | ||
| 51 | - <textarea id="c-content" class="form-control editor" rows="5" name="row[content]" cols="50"></textarea> | ||
| 52 | - </div> | ||
| 53 | - </div> | 63 | + |
| 54 | <div class="form-group"> | 64 | <div class="form-group"> |
| 55 | <label class="control-label col-xs-12 col-sm-2">{:__('Phone')}:</label> | 65 | <label class="control-label col-xs-12 col-sm-2">{:__('Phone')}:</label> |
| 56 | <div class="col-xs-12 col-sm-8"> | 66 | <div class="col-xs-12 col-sm-8"> |
| @@ -27,6 +27,20 @@ | @@ -27,6 +27,20 @@ | ||
| 27 | </div> | 27 | </div> |
| 28 | </div> | 28 | </div> |
| 29 | <div class="form-group"> | 29 | <div class="form-group"> |
| 30 | + <label class="control-label col-xs-12 col-sm-2">{:__('Poster')}:</label> | ||
| 31 | + <div class="col-xs-12 col-sm-8"> | ||
| 32 | + <div class="input-group"> | ||
| 33 | + <input id="c-poster" class="form-control" size="50" name="row[poster]" type="text" value="{$row.poster|htmlentities}"> | ||
| 34 | + <div class="input-group-addon no-border no-padding"> | ||
| 35 | + <span><button type="button" id="faupload-poster" class="btn btn-danger faupload" data-input-id="c-poster" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-poster"><i class="fa fa-upload"></i> {:__('Upload')}</button></span> | ||
| 36 | + <span><button type="button" id="fachoose-poster" class="btn btn-primary fachoose" data-input-id="c-poster" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span> | ||
| 37 | + </div> | ||
| 38 | + <span class="msg-box n-right" for="c-poster"></span> | ||
| 39 | + </div> | ||
| 40 | + <ul class="row list-inline faupload-preview" id="p-poster"></ul> | ||
| 41 | + </div> | ||
| 42 | + </div> | ||
| 43 | + <div class="form-group"> | ||
| 30 | <label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label> | 44 | <label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label> |
| 31 | <div class="col-xs-12 col-sm-8"> | 45 | <div class="col-xs-12 col-sm-8"> |
| 32 | <input id="c-title" class="form-control" name="row[title]" type="text" value="{$row.title|htmlentities}"> | 46 | <input id="c-title" class="form-control" name="row[title]" type="text" value="{$row.title|htmlentities}"> |
| @@ -44,12 +58,7 @@ | @@ -44,12 +58,7 @@ | ||
| 44 | <input id="c-price" class="form-control" name="row[price]" type="number" value="{$row.price|htmlentities}"> | 58 | <input id="c-price" class="form-control" name="row[price]" type="number" value="{$row.price|htmlentities}"> |
| 45 | </div> | 59 | </div> |
| 46 | </div> | 60 | </div> |
| 47 | - <div class="form-group"> | ||
| 48 | - <label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label> | ||
| 49 | - <div class="col-xs-12 col-sm-8"> | ||
| 50 | - <textarea id="c-content" class="form-control editor" rows="5" name="row[content]" cols="50">{$row.content|htmlentities}</textarea> | ||
| 51 | - </div> | ||
| 52 | - </div> | 61 | + |
| 53 | <div class="form-group"> | 62 | <div class="form-group"> |
| 54 | <label class="control-label col-xs-12 col-sm-2">{:__('Phone')}:</label> | 63 | <label class="control-label col-xs-12 col-sm-2">{:__('Phone')}:</label> |
| 55 | <div class="col-xs-12 col-sm-8"> | 64 | <div class="col-xs-12 col-sm-8"> |
| @@ -9,19 +9,19 @@ | @@ -9,19 +9,19 @@ | ||
| 9 | <div class="form-group"> | 9 | <div class="form-group"> |
| 10 | <label class="control-label col-xs-12 col-sm-2">{:__('Address')}:</label> | 10 | <label class="control-label col-xs-12 col-sm-2">{:__('Address')}:</label> |
| 11 | <div class="col-xs-12 col-sm-8"> | 11 | <div class="col-xs-12 col-sm-8"> |
| 12 | - <input id="c-address" class="form-control" name="row[address]" type="text"> | 12 | + <input id="c-address" class="form-control" data-lat-id="c-lat" data-lng-id="c-lng" data-input-id="c-address" data-toggle="addresspicker" name="row[address]" type="text"> |
| 13 | </div> | 13 | </div> |
| 14 | </div> | 14 | </div> |
| 15 | <div class="form-group"> | 15 | <div class="form-group"> |
| 16 | <label class="control-label col-xs-12 col-sm-2">{:__('Lat')}:</label> | 16 | <label class="control-label col-xs-12 col-sm-2">{:__('Lat')}:</label> |
| 17 | <div class="col-xs-12 col-sm-8"> | 17 | <div class="col-xs-12 col-sm-8"> |
| 18 | - <input id="c-lat" class="form-control" name="row[lat]" type="text"> | 18 | + <input id="c-lat" class="form-control" name="row[lat]" readonly type="text"> |
| 19 | </div> | 19 | </div> |
| 20 | </div> | 20 | </div> |
| 21 | <div class="form-group"> | 21 | <div class="form-group"> |
| 22 | <label class="control-label col-xs-12 col-sm-2">{:__('Lng')}:</label> | 22 | <label class="control-label col-xs-12 col-sm-2">{:__('Lng')}:</label> |
| 23 | <div class="col-xs-12 col-sm-8"> | 23 | <div class="col-xs-12 col-sm-8"> |
| 24 | - <input id="c-lng" class="form-control" name="row[lng]" type="text"> | 24 | + <input id="c-lng" class="form-control" name="row[lng]" readonly type="text"> |
| 25 | </div> | 25 | </div> |
| 26 | </div> | 26 | </div> |
| 27 | <div class="form-group"> | 27 | <div class="form-group"> |
| @@ -9,19 +9,19 @@ | @@ -9,19 +9,19 @@ | ||
| 9 | <div class="form-group"> | 9 | <div class="form-group"> |
| 10 | <label class="control-label col-xs-12 col-sm-2">{:__('Address')}:</label> | 10 | <label class="control-label col-xs-12 col-sm-2">{:__('Address')}:</label> |
| 11 | <div class="col-xs-12 col-sm-8"> | 11 | <div class="col-xs-12 col-sm-8"> |
| 12 | - <input id="c-address" class="form-control" name="row[address]" type="text" value="{$row.address|htmlentities}"> | 12 | + <input id="c-address" class="form-control" data-lat-id="c-lat" data-lng-id="c-lng" data-input-id="c-address" data-toggle="addresspicker" name="row[address]" type="text" value="{$row.address|htmlentities}"> |
| 13 | </div> | 13 | </div> |
| 14 | </div> | 14 | </div> |
| 15 | <div class="form-group"> | 15 | <div class="form-group"> |
| 16 | <label class="control-label col-xs-12 col-sm-2">{:__('Lat')}:</label> | 16 | <label class="control-label col-xs-12 col-sm-2">{:__('Lat')}:</label> |
| 17 | <div class="col-xs-12 col-sm-8"> | 17 | <div class="col-xs-12 col-sm-8"> |
| 18 | - <input id="c-lat" class="form-control" name="row[lat]" type="text" value="{$row.lat|htmlentities}"> | 18 | + <input id="c-lat" class="form-control" name="row[lat]" type="text" readonly value="{$row.lat|htmlentities}"> |
| 19 | </div> | 19 | </div> |
| 20 | </div> | 20 | </div> |
| 21 | <div class="form-group"> | 21 | <div class="form-group"> |
| 22 | <label class="control-label col-xs-12 col-sm-2">{:__('Lng')}:</label> | 22 | <label class="control-label col-xs-12 col-sm-2">{:__('Lng')}:</label> |
| 23 | <div class="col-xs-12 col-sm-8"> | 23 | <div class="col-xs-12 col-sm-8"> |
| 24 | - <input id="c-lng" class="form-control" name="row[lng]" type="text" value="{$row.lng|htmlentities}"> | 24 | + <input id="c-lng" class="form-control" name="row[lng]" type="text" readonly value="{$row.lng|htmlentities}"> |
| 25 | </div> | 25 | </div> |
| 26 | </div> | 26 | </div> |
| 27 | <div class="form-group"> | 27 | <div class="form-group"> |
| @@ -260,18 +260,42 @@ class Business extends Api | @@ -260,18 +260,42 @@ class Business extends Api | ||
| 260 | * 9、用户员工管理 | 260 | * 9、用户员工管理 |
| 261 | */ | 261 | */ |
| 262 | public function userstaff(){ | 262 | public function userstaff(){ |
| 263 | - | 263 | + $store_id=$this->store_id; |
| 264 | + //查询员工 | ||
| 265 | + $page = $this->request->post('page', 1); | ||
| 266 | + $total = $this->request->post('total', 10); | ||
| 267 | + $where["a.verification_store_id"] = ["=", $this->store_id]; | ||
| 268 | + $staff=Db::name('verification_staff') | ||
| 269 | + ->where($where) | ||
| 270 | + ->paginate($total, false, ['page' => $page]) | ||
| 271 | + ->toArray(); | ||
| 272 | + $this->success("查询成功",$staff); | ||
| 264 | } | 273 | } |
| 265 | 274 | ||
| 266 | /** | 275 | /** |
| 267 | *10、修改员工职务 | 276 | *10、修改员工职务 |
| 268 | */ | 277 | */ |
| 269 | - public function updatestaff(){} | 278 | + public function updatestaff(){ |
| 279 | + $id=$this->postParam['id']; | ||
| 280 | + $type=$this->postParam['type']; | ||
| 281 | + $res=Db::name('verification_staff') | ||
| 282 | + ->where('id',$id) | ||
| 283 | + ->update([ | ||
| 284 | + 'type'=>$type | ||
| 285 | + ]); | ||
| 286 | + if($res){ | ||
| 287 | + $this->success("修改成功"); | ||
| 288 | + }else{ | ||
| 289 | + $this->error("修改异常"); | ||
| 290 | + } | ||
| 291 | + } | ||
| 270 | 292 | ||
| 271 | /** | 293 | /** |
| 272 | * 11、邀请代理二维码 | 294 | * 11、邀请代理二维码 |
| 273 | */ | 295 | */ |
| 274 | - public function inviteagent(){} | ||
| 275 | - | 296 | + public function inviteagent(){ |
| 297 | + $image=$this->store['agent_image']; | ||
| 298 | + $this->success("查询成功",$image); | ||
| 276 | 299 | ||
| 300 | + } | ||
| 277 | } | 301 | } |
| @@ -34,6 +34,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin | @@ -34,6 +34,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin | ||
| 34 | {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, | 34 | {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, |
| 35 | {field: 'closetime', title: __('Closetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, | 35 | {field: 'closetime', title: __('Closetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, |
| 36 | {field: 'image', title: __('Image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, | 36 | {field: 'image', title: __('Image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, |
| 37 | + {field: 'poster', title: __('Poster'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, | ||
| 37 | {field: 'price', title: __('Price'), operate:'BETWEEN'}, | 38 | {field: 'price', title: __('Price'), operate:'BETWEEN'}, |
| 38 | {field: 'phone', title: __('Phone'), operate: 'LIKE'}, | 39 | {field: 'phone', title: __('Phone'), operate: 'LIKE'}, |
| 39 | {field: 'store.name', title: __('Store.name'), operate: 'LIKE'}, | 40 | {field: 'store.name', title: __('Store.name'), operate: 'LIKE'}, |
| @@ -28,10 +28,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin | @@ -28,10 +28,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin | ||
| 28 | {field: 'id', title: __('Id')}, | 28 | {field: 'id', title: __('Id')}, |
| 29 | {field: 'name', title: __('Name'), operate: 'LIKE'}, | 29 | {field: 'name', title: __('Name'), operate: 'LIKE'}, |
| 30 | {field: 'address', title: __('Address'), operate: 'LIKE'}, | 30 | {field: 'address', title: __('Address'), operate: 'LIKE'}, |
| 31 | - {field: 'lat', title: __('Lat'), operate: 'LIKE'}, | ||
| 32 | - {field: 'lng', title: __('Lng'), operate: 'LIKE'}, | ||
| 33 | {field: 'phone', title: __('Phone'), operate: 'LIKE'}, | 31 | {field: 'phone', title: __('Phone'), operate: 'LIKE'}, |
| 34 | {field: 'image', title: __('Image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, | 32 | {field: 'image', title: __('Image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, |
| 33 | + {field: 'agent_image', title: __('Agent_image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, | ||
| 35 | {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate, | 34 | {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate, |
| 36 | buttons:[ | 35 | buttons:[ |
| 37 | 36 |
-
请 注册 或 登录 后发表评论