From a4b3ee325c7354579d495bc74a777e494e5ec38c Mon Sep 17 00:00:00 2001
From: quanwei <419654421@qq.com>
Date: Fri, 06 Feb 2026 18:18:44 +0800
Subject: [PATCH] 商品可以价格面议 选择走访时显示输入走访企业名 分会添加活动时要总会审核 分类添加人数限制,添加活动选择了填写人数限制的分类时活动名额下显示该分类人数限制为15 同一个企业30天内只能走访一次,在30天内走访同一个企业时提示该企业已被走访xx天后才可以从新走访
---
admin/app/api/model/page/Page.php | 48 +++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 45 insertions(+), 3 deletions(-)
diff --git a/admin/app/api/model/page/Page.php b/admin/app/api/model/page/Page.php
index 6e664d2..ea2752c 100644
--- a/admin/app/api/model/page/Page.php
+++ b/admin/app/api/model/page/Page.php
@@ -4,6 +4,8 @@
use app\api\model\product\Product as ProductModel;
use app\api\model\plus\article\Article;
+use app\api\model\supplier\Category;
+use app\common\enum\supplier\SupplierType;
use app\common\model\page\Page as PageModel;
use app\api\model\plus\coupon\Coupon;
use app\api\model\plus\seckill\Product as SeckillProductModel;
@@ -14,7 +16,7 @@
use app\api\model\plus\bargain\Active as BargainActiveModel;
use app\api\model\plus\live\Room as RoomModel;
use app\api\model\plus\release\Project;
-
+use app\api\model\supplier\Supplier as SupplierModel;
/**
* 首页模型
*/
@@ -32,7 +34,7 @@
/**
* DIY页面详情
*/
- public static function getPageData($user, $page_id = null,$city_supplier_ids='')
+ public static function getPageData($user, $page_id = null,$city_supplier_ids='',$latitude=0,$longitude=0)
{
// 页面详情
$detail = $page_id > 0 ? parent::detail($page_id) : parent::getDefault();
@@ -55,7 +57,7 @@
} else if ($item['type'] === 'article') {
$items[$key]['data'] = $model->getArticleList($item);
}else if ($item['type'] === 'hdzq') {
- $items[$key]['data'] = $model->getReleaseList($item);
+ $items[$key]['data'] = $model->getReleaseList($item,$user);
}else if ($item['type'] === 'gxpp') {
$items[$key]['data'] = $model->getReleaseList($item,$user);
} else if ($item['type'] === 'special') {
@@ -88,6 +90,11 @@
$items[$key]['data'] = $model->getLiveList($item);
} else if ($item['type'] === 'previewProduct') {
$items[$key]['data'] = $model->getPreviewList($user, $item);
+ } else if ($item['type'] === 'groupBuy') {
+ // 团购组件
+ //$items[$key]['data'] = $model->getGroupBuyList($user, $item, $city_supplier_ids, $latitude, $longitude);
+ $items[$key]['style']['server_score_image']=$items[$key]['style']['server_score_image']==self::$base_url . 'image/diy/product/01.png'?'':$items[$key]['style']['server_score_image'];
+ //$items[$key]['category']=(new Category())->getALL(['category_type'=>SupplierType::GROUPBUYING]);
}
}
return ['page' => $items['page'], 'items' => $items];
@@ -114,6 +121,7 @@
'list_rows' => $item['params']['auto']['showNum'],
'audit_status' => 10,
'city_supplier_ids' => $city_supplier_ids,
+ 'is_gift_pack' => 0,
], $user);
}
if ($productList->isEmpty()) return [];
@@ -125,6 +133,7 @@
'product_id' => $product['product_id'],
'product_name' => $product['product_name'],
'selling_point' => $product['selling_point'],
+ 'is_price_negotiable' => $product['is_price_negotiable'],
'image' => $product['image'][0]['file_path'],
'product_image' => $product['image'][0]['file_path'],
'product_price' => $show_sku['product_price'],
@@ -265,4 +274,37 @@
}
return $data;
}
+ public function getSupplierList($item)
+ {
+ $model = new SupplierModel();
+ $list = $model->getList([
+ 'list_rows' => $item['params']['showNum']
+ ]);
+ return $list->isEmpty() ? [] : $list->toArray()['data'];
+ }
+
+ /**
+ * 团购组件:获取团购商户列表
+ */
+ private function getGroupBuyList($user, $item, $city_supplier_ids = '', $latitude = 0, $longitude = 0)
+ {
+ // 获取团购数据
+ $model = new SupplierModel();
+ $params = [
+ 'list_rows' => isset($item['params']['showNum']) ? $item['params']['showNum'] : 10,
+ 'sortType' => isset($item['params']['merchantSort']) ? $item['params']['merchantSort'] : 'all',
+ 'product_num' => isset($item['params']['product_num']) ? $item['params']['product_num'] : 3,
+ 'city_supplier_ids' => $city_supplier_ids,
+ 'latitude' => $latitude,
+ 'longitude' => $longitude,
+ ];
+
+ // 如果有分类筛选
+ if (isset($item['params']['category_id']) && $item['params']['category_id']) {
+ $params['category_id'] = $item['params']['category_id'];
+ }
+
+ $list = $model->getGroupBuyList($params);
+ return empty($list['data']) ? [] : $list['data'];
+ }
}
\ No newline at end of file
--
Gitblit v1.9.2