Przeglądaj źródła

商家运费模板-取消硬编码

Xpy 4 miesięcy temu
rodzic
commit
8e1361b979

+ 5 - 1
app/common/dao/store/shipping/ShippingTemplateDao.php

@@ -86,7 +86,11 @@ class ShippingTemplateDao  extends BaseDao
86 86
 
87 87
     public function getList($merId)
88 88
     {
89
-        return ($this->getModel())::getDB()->where('mer_id',$merId)->field('shipping_template_id,name')->select();
89
+//        return ($this->getModel())::getDB()->where('mer_id',$merId)->field('shipping_template_id,name')->select();
90
+        $list = ($this->getModel())::getDB()->where('mer_id',$merId)->field('shipping_template_id,name')->select()->toArray();
91
+        $default = ['shipping_template_id' => 105, 'name' => '默认包邮'];//默认
92
+        $list[] = $default;
93
+        return $list;
90 94
     }
91 95
 
92 96
     /**

+ 2 - 3
app/controller/merchant/store/shipping/ShippingTemplate.php

@@ -47,9 +47,8 @@ class ShippingTemplate extends BaseController
47 47
      */
48 48
     public function getList()
49 49
     {
50
-//        return app('json')->success($this->repository->getList($this->request->merId()));
51
-        // 目前只包邮
52
-        return app('json')->success($this->repository->getList(0));
50
+        return app('json')->success($this->repository->getList($this->request->merId()));
51
+//        return app('json')->success($this->repository->getList(0));  取消硬编码
53 52
     }
54 53
 
55 54
     /**