|
|
@@ -11,11 +11,12 @@ use app\common\model\ProductOrder;
|
|
|
use app\common\model\ProductsModel;
|
|
|
use app\common\model\ProductPopular;
|
|
|
use app\api\logic\OrderLogic;
|
|
|
-use app\common\model\UserCollect;
|
|
|
|
|
|
class Product extends Api
|
|
|
{
|
|
|
protected array $noNeedLogin = ['getPopularList'];
|
|
|
+
|
|
|
+
|
|
|
protected string $lan = '';
|
|
|
|
|
|
public function _initialize()
|
|
|
@@ -108,8 +109,8 @@ class Product extends Api
|
|
|
if(!empty($key_val)) $map['b.'.$this->lan.'_name'] = ['like', '%'.$key_val.'%'];
|
|
|
$list = $productMarket->alias('a')
|
|
|
->join("product_list b", "a.product_id = b.id", "left")
|
|
|
- ->join("user_collect c", "c.market_id = a.id", "left")
|
|
|
- ->field('a.id,'.'b.'.$this->lan.'_name as name,b.thum as img_url,a.price,a.product_id,a.type_id, count(c.market_id) as collect')
|
|
|
+ ->join("user_collect c", "c.market_id = a.id and c.user_id = {$this->auth->id}")
|
|
|
+ ->field('a.id,'.'b.'.$this->lan.'_name as name,b.thum as img_url,a.price,a.product_id,a.type_id')
|
|
|
->where('a.status', $productMarket::Normal)
|
|
|
->where($map)
|
|
|
->order($order)
|