sunxbiao 1 год назад
Родитель
Сommit
a0f6f59647
1 измененных файлов с 7 добавлено и 3 удалено
  1. 7 3
      app/common/repositories/store/coupon/StoreCouponRepository.php

+ 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 182
         $return=[];
179 183
         foreach ($data as $k => $item){
180 184
             $return [] = ['value' => $item['mer_id'],  'label' => $item['mer_name']];
@@ -189,7 +193,7 @@ class StoreCouponRepository extends BaseRepository
189 193
      * @author xaboy
190 194
      * @day 2020/5/20
191 195
      */
192
-    public function form($merId)
196
+    public function form($merId = null)
193 197
     {
194 198
         return Elm::createForm(Route::buildUrl('merchantCouponCreate')->build(), [
195 199
             Elm::input('title', '优惠券名称')->required(),