|
@@ -22,6 +22,7 @@ use app\common\{cache\HandleConcurrencyCache,
|
|
|
enum\UserTerminalEnum,
|
|
enum\UserTerminalEnum,
|
|
|
model\Goods,
|
|
model\Goods,
|
|
|
enum\GoodsEnum,
|
|
enum\GoodsEnum,
|
|
|
|
|
+ model\GoodsItem,
|
|
|
model\SearchRecord,
|
|
model\SearchRecord,
|
|
|
service\ConfigService};
|
|
service\ConfigService};
|
|
|
use think\facade\Db;
|
|
use think\facade\Db;
|
|
@@ -50,6 +51,7 @@ class GoodsLists extends BaseShopDataLists
|
|
|
*/
|
|
*/
|
|
|
public function lists(): array
|
|
public function lists(): array
|
|
|
{
|
|
{
|
|
|
|
|
+
|
|
|
//读取缓存
|
|
//读取缓存
|
|
|
$HandleConcurrencyCache = new HandleConcurrencyCache();
|
|
$HandleConcurrencyCache = new HandleConcurrencyCache();
|
|
|
$list = $HandleConcurrencyCache->getCache($HandleConcurrencyCache->getGoodsListsKey(md5(serialize($this->params))));
|
|
$list = $HandleConcurrencyCache->getCache($HandleConcurrencyCache->getGoodsListsKey(md5(serialize($this->params))));
|
|
@@ -63,6 +65,14 @@ class GoodsLists extends BaseShopDataLists
|
|
|
->limit($this->limitOffset, $this->limitLength)
|
|
->limit($this->limitOffset, $this->limitLength)
|
|
|
->order('sort desc,id desc')
|
|
->order('sort desc,id desc')
|
|
|
->select();
|
|
->select();
|
|
|
|
|
+ foreach($list as &$gv){
|
|
|
|
|
+ $goods_item_count = GoodsItem::where(['goods_id'=>$gv['id']])->count();
|
|
|
|
|
+ if($goods_item_count > 1){
|
|
|
|
|
+ $gv['is_multi_gauge'] = 1;
|
|
|
|
|
+ }else{
|
|
|
|
|
+ $gv['is_multi_gauge'] = 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
$showPrice = ConfigService::get('goods_set', 'show_price', 1);
|
|
$showPrice = ConfigService::get('goods_set', 'show_price', 1);
|
|
|
if(0 == $showPrice){
|
|
if(0 == $showPrice){
|
|
|
foreach ($list as $goods){
|
|
foreach ($list as $goods){
|