lizhen_gitee hai 3 meses
pai
achega
9900e244b6
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      application/api/controller/Index.php

+ 3 - 1
application/api/controller/Index.php

@@ -4,6 +4,7 @@ namespace app\api\controller;
 
 use app\common\controller\Api;
 use think\Db;
+use addons\unishop\model\Product as productModel;
 /**
  * 首页接口
  */
@@ -41,7 +42,8 @@ class Index extends Api
             'switch' => 1,
             'deletetime' => null,
         ];
-        $index_show_product = Db::name('unishop_product')->field('id,image,title')->where($map)->find();
+        $productModel = new productModel();
+        $index_show_product = $productModel->field('id,image,title')->where($map)->find();
         $index_show_product = info_domain_image($index_show_product,['image']);