|
@@ -155,16 +155,16 @@ class Goods extends Base
|
|
//关键词
|
|
//关键词
|
|
if (isset($param['keyword']) && !empty($param['keyword'])) {
|
|
if (isset($param['keyword']) && !empty($param['keyword'])) {
|
|
$query->where('title|keywords', 'like', '%' . $param['keyword'] . '%');
|
|
$query->where('title|keywords', 'like', '%' . $param['keyword'] . '%');
|
|
- $log = \addons\shop\model\SearchLog::getByKeywords($param['keyword']);
|
|
|
|
|
|
+ $log = \app\common\model\SearchLog::getByKeywords($param['keyword']);
|
|
if ($log) {
|
|
if ($log) {
|
|
$log->setInc("nums");
|
|
$log->setInc("nums");
|
|
} else {
|
|
} else {
|
|
- \addons\shop\model\SearchLog::create(['keywords' => $param['keyword'], 'nums' => 1, 'status' => 'hidden']);
|
|
|
|
|
|
+ \app\common\model\SearchLog::create(['keywords' => $param['keyword'], 'nums' => 1, 'status' => 'hidden']);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//分类
|
|
//分类
|
|
if (isset($param['category_id']) && !empty($param['category_id'])) {
|
|
if (isset($param['category_id']) && !empty($param['category_id'])) {
|
|
- $categoryIds = \addons\shop\model\Category::getCategoryChildrenIds($param['category_id']);
|
|
|
|
|
|
+ $categoryIds = \app\common\model\Category::getCategoryChildrenIds($param['category_id']);
|
|
$query->where(function($q) use ($categoryIds) {
|
|
$query->where(function($q) use ($categoryIds) {
|
|
foreach ($categoryIds as $categoryId) {
|
|
foreach ($categoryIds as $categoryId) {
|
|
$q->whereOr('category_ids', 'exp', "FIND_IN_SET('{$categoryId}', category_ids)");
|
|
$q->whereOr('category_ids', 'exp', "FIND_IN_SET('{$categoryId}', category_ids)");
|
|
@@ -173,7 +173,7 @@ class Goods extends Base
|
|
}
|
|
}
|
|
//属性
|
|
//属性
|
|
if (isset($param['attributes']) && !empty($param['attributes'])) {
|
|
if (isset($param['attributes']) && !empty($param['attributes'])) {
|
|
- $query->where('id', 'IN', \addons\shop\model\GoodsAttr::getGoodsIds($param['attributes']));
|
|
|
|
|
|
+ $query->where('id', 'IN', \app\common\model\GoodsAttr::getGoodsIds($param['attributes']));
|
|
}
|
|
}
|
|
//品牌
|
|
//品牌
|
|
if (isset($param['brand_id']) && !empty($param['brand_id'])) {
|
|
if (isset($param['brand_id']) && !empty($param['brand_id'])) {
|
|
@@ -214,7 +214,7 @@ class Goods extends Base
|
|
$user_id = $this->auth->id;
|
|
$user_id = $this->auth->id;
|
|
}
|
|
}
|
|
$resource = '';
|
|
$resource = '';
|
|
- $fileStream = (new \addons\shop\library\message\Mini)->getWxCodeUnlimited([
|
|
|
|
|
|
+ $fileStream = (new \app\common\library\message\Mini)->getWxCodeUnlimited([
|
|
'scene' => "invite_id={$user_id}&goods_id={$goods_id}",
|
|
'scene' => "invite_id={$user_id}&goods_id={$goods_id}",
|
|
'env_version' => $version, //要打开的小程序版本。正式版为 release,体验版为 trial,开发版为 develop
|
|
'env_version' => $version, //要打开的小程序版本。正式版为 release,体验版为 trial,开发版为 develop
|
|
'page' => 'pages/goods/detail',
|
|
'page' => 'pages/goods/detail',
|