Ver código fonte

Merge branch 'dev' into dev-sxb

sunxbiao 1 ano atrás
pai
commit
c7c33d60ad

+ 7 - 3
app/common/repositories/store/coupon/StoreCouponRepository.php

@@ -172,9 +172,13 @@ class StoreCouponRepository extends BaseRepository
172
     }
172
     }
173
 
173
 
174
     /*店铺列表*/
174
     /*店铺列表*/
175
-    public function merList($merId)
175
+    public function merList($merId = null)
176
     {
176
     {
177
-        $data =  Db::name("merchant")->where(['status'=>1,'mer_id'=>$merId])->field('mer_id,mer_name')->select()->toArray();
177
+        $where = ['status'=>1];
178
+        if (!empty($merId)) {
179
+            $where['mer_id'] = $merId;
180
+        }
181
+        $data =  Db::name("merchant")->where($where)->field('mer_id,mer_name')->select()->toArray();
178
         $return=[];
182
         $return=[];
179
         foreach ($data as $k => $item){
183
         foreach ($data as $k => $item){
180
             $return [] = ['value' => $item['mer_id'],  'label' => $item['mer_name']];
184
             $return [] = ['value' => $item['mer_id'],  'label' => $item['mer_name']];
@@ -189,7 +193,7 @@ class StoreCouponRepository extends BaseRepository
189
      * @author xaboy
193
      * @author xaboy
190
      * @day 2020/5/20
194
      * @day 2020/5/20
191
      */
195
      */
192
-    public function form($merId)
196
+    public function form($merId = null)
193
     {
197
     {
194
         return Elm::createForm(Route::buildUrl('merchantCouponCreate')->build(), [
198
         return Elm::createForm(Route::buildUrl('merchantCouponCreate')->build(), [
195
             Elm::input('title', '优惠券名称')->required(),
199
             Elm::input('title', '优惠券名称')->required(),