lizhen_gitee 3 tháng trước cách đây
mục cha
commit
9900e244b6
1 tập tin đã thay đổi với 3 bổ sung1 xóa
  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']);