@@ -53,6 +53,7 @@ class Product extends Controller
// 查询数据
$result = $ProductModel->query()
->where($map)
+ ->with(['product_keyword'])
->orderByDesc('id')
->paginate($limit)->toarray();
// 分配数据
@@ -74,6 +74,7 @@ class LowPriceGoods extends Controller
}
$result = $LowPriceGoodsModel
@@ -74,6 +74,7 @@ class ViolationProduct extends Controller
$result = $ViolationProductModel
@@ -49,6 +49,16 @@ class Product extends Model
return $Product_id;
+ /**
+ * 连表查询商品关键字
+ * @author 唐远望
+ * @version 1.0
+ * @date 2026-03-31
+ */
+ public function product_keyword(){
+ return $this->hasMany(ProductKeywordModel::class,'collect_product_id','id');
+ }
+
/**
* 写入数据
@@ -53,6 +53,17 @@ class LowPriceGoods extends Model
+ return $this->hasMany(LowPriceGoodsKeywordModel::class,'lowprice_product_logid','id');
* @author 唐远望
@@ -54,6 +54,17 @@ class ViolationProduct extends Model
+ return $this->hasMany(ViolationProductKeywordModel::class,'violation_product_id','id');