From 04102f7237efefa744090ed7c25f7b5d0807b679 Mon Sep 17 00:00:00 2001
From: quanwei <419654421@qq.com>
Date: Thu, 05 Feb 2026 18:11:57 +0800
Subject: [PATCH] 完成运营中心提现和运营中心权限管理
---
admin/app/api/model/page/Page.php | 65 ++++++++++++++++++++++++++++++--
1 files changed, 61 insertions(+), 4 deletions(-)
diff --git a/admin/app/api/model/page/Page.php b/admin/app/api/model/page/Page.php
index 1798152..fa4eb98 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;
@@ -13,7 +15,8 @@
use app\api\model\plus\bargain\Product as BargainProductModel;
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;
/**
* 首页模型
*/
@@ -31,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();
@@ -53,6 +56,10 @@
$items[$key]['data'] = $model->getCouponList($user, $item, true, 1);
} else if ($item['type'] === 'article') {
$items[$key]['data'] = $model->getArticleList($item);
+ }else if ($item['type'] === 'hdzq') {
+ $items[$key]['data'] = $model->getReleaseList($item,$user);
+ }else if ($item['type'] === 'gxpp') {
+ $items[$key]['data'] = $model->getReleaseList($item,$user);
} else if ($item['type'] === 'special') {
$items[$key]['data'] = $model->getSpecialList($item);
} else if ($item['type'] === 'seckillProduct') {
@@ -83,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];
@@ -109,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 [];
@@ -147,8 +160,19 @@
{
// 获取文章数据
$model = new Article;
- $articleList = $model->getList($item['params']['auto']['category'], $item['params']['auto']['showNum'],0);
+ $articleList = $model->getList($item['params']['auto']['category'], $item['params']['auto']['showNum']);
return $articleList->isEmpty() ? [] : $articleList->toArray()['data'];
+ }
+
+ /**
+ * 获取供需列表
+ */
+ private function getReleaseList($item,$user=[])
+ {
+ // 获取数据
+ $model = new Project;
+ $list = $model->getIndexList($user,$item['params']['auto']['showNum']);
+ return $list->isEmpty() ? [] : $list->toArray()['data'];
}
/**
@@ -158,7 +182,7 @@
{
// 获取头条数据
$model = new Article;
- $articleList = $model->getList($item['params']['auto']['category'], $item['params']['auto']['showNum'],0);
+ $articleList = $model->getList($item['params']['auto']['category'], $item['params']['auto']['showNum']);
return $articleList->isEmpty() ? [] : $articleList->toArray()['data'];
}
@@ -249,4 +273,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