Skip to content

Commit 48b51c1

Browse files
author
yanglin
committed
hg
1 parent 2d95223 commit 48b51c1

File tree

4 files changed

+24
-4
lines changed

4 files changed

+24
-4
lines changed

models/Shop.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public static function tableName()
3939
public function rules()
4040
{
4141
return [
42-
[['store_id', 'is_delete', 'addtime', 'score'], 'integer'],
42+
[['hg_id','store_id', 'is_delete', 'addtime', 'score'], 'integer'],
4343
[['longitude', 'latitude', 'cover_url', 'pic_url', 'content'], 'string'],
4444
[['name', 'mobile', 'address', 'shop_time'], 'string', 'max' => 255],
4545
];
@@ -61,6 +61,7 @@ public function attributeLabels()
6161
'longitude' => 'Longitude',
6262
'latitude' => 'Latitude',
6363
'score' => '评分 1~5',
64+
'hg_id' => 'hg',
6465
'cover_url' => '门店大图',
6566
'pic_url' => '门店小图',
6667
'shop_time' => '营业时间',

modules/api/controllers/couponmall/IndexController.php

+8-2
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,14 @@ public function actionOpendoor()
125125
//如果柜子存在
126126
if(empty($shop['code']) && $shop['success']){
127127
//如果货柜编号相等//调用补货接口开门
128-
$hg_id=$hg_id;
129-
128+
if(!isset($shop['data']['shop']['hg_id']) || $hg_id != $shop['data']['shop']['hg_id']){
129+
return json_encode([
130+
'code' => '1',
131+
'msg' => '不是您的货柜',
132+
'success' => false,
133+
'data' => '不是您的货柜',
134+
],JSON_UNESCAPED_UNICODE);
135+
}
130136
//开始调用货柜补货
131137
unset($biz_content['unionid']);
132138
//不用同步用户信息

modules/mch/models/ShopForm.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,14 @@ class ShopForm extends Model
3535
public $content;
3636
public $shop_time;
3737
public $shop_pic;
38+
public $hg_id;
3839

3940
public function rules()
4041
{
4142
return [
4243
[['name', 'mobile', 'address','latitude','longitude'], 'required'],
4344
[['name', 'mobile', 'address','latitude','longitude','cover_url','pic_url','content','shop_time'], 'string'],
44-
[['name', 'mobile', 'address','cover_url','pic_url','content','shop_time'], 'trim'],
45+
[['hg_id','name', 'mobile', 'address','cover_url','pic_url','content','shop_time'], 'trim'],
4546
[['score'],'integer','min'=>1,'max'=>5],
4647
[['shop_pic'],'safe']
4748
];
@@ -56,6 +57,7 @@ public function attributeLabels()
5657
'latitude'=>'经纬度',
5758
'longitude'=>'经纬度',
5859
'score'=>'评分',
60+
'hg_id'=>'hg',
5961
'cover_url'=>'货柜大图',
6062
'pic_url'=>'门店小图',
6163
'content'=>'门店介绍',

modules/mch/views/store/shop-edit.php

+11
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,17 @@
159159
<div class="text-danger">仅支持1~5的评分</div>
160160
</div>
161161
</div>
162+
163+
<div class="form-group row">
164+
<div class="col-3 text-right">
165+
<label class=" col-form-label">货柜设置实体货柜编号(关联):</label>
166+
</div>
167+
<div class="col-9">
168+
<input class="form-control" type="number" name="hg_id" min="1" max="100000000"
169+
value="<?= $shop->hg_id ? $shop->hg_id : 0 ?>">
170+
<div class="text-danger">只设置数字,到微信小程序后台发布链接该二维码,并把二维码制作在实体货柜上</div>
171+
</div>
172+
</div>
162173
<div class="form-group row">
163174
<div class="col-3 text-right">
164175
<label class=" col-form-label">营业时间:</label>

0 commit comments

Comments
 (0)