From 5038376e2c53ff019ee4a1b65e54eee988fa881f Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Sat, 11 Nov 2023 17:28:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/api/Statistics.php | 4 ++-- app/controller/api/server/StoreCategory.php | 10 ++++++++++ route/api.php | 1 + 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/app/controller/api/Statistics.php b/app/controller/api/Statistics.php index 2ecbda3e..e94d16d3 100644 --- a/app/controller/api/Statistics.php +++ b/app/controller/api/Statistics.php @@ -149,13 +149,13 @@ class Statistics extends BaseController if (!isset($parmas['goods_id']) || $parmas['goods_id'] == '') { return app('json')->fail('goods_id:格式错误'); } - + $mer_id=Db::name('merchant_intention')->where('mer_intention_id', $parmas['mer_intention_id'])->value('mer_id'); $where[] = ['p.create_time', 'between time', [date("Y-m-d H:i:s", $parmas['start_time']), date("Y-m-d H:i:s", $parmas['end_time'])]]; $where[] = ['p.product_id', 'in', explode(',', $parmas['goods_id'])]; $where[] = ['p.is_refund', '=', 0]; $count = Db::name('store_order_product')->alias('p') ->where($where) - ->join('store_order o', 'o.mer_id=' . $parmas['mer_intention_id'] . ' and o.paid=1 and o.is_del=0') + ->join('store_order o', 'o.mer_id=' . $mer_id . ' and o.paid=1 and o.is_del=0') ->sum('p.total_price'); return app('json')->success(['procure_amount' => $count]); } diff --git a/app/controller/api/server/StoreCategory.php b/app/controller/api/server/StoreCategory.php index 6510f223..4d7208be 100644 --- a/app/controller/api/server/StoreCategory.php +++ b/app/controller/api/server/StoreCategory.php @@ -16,6 +16,7 @@ use crmeb\basic\BaseController; use think\exception\HttpResponseException; use app\validate\admin\StoreCategoryValidate; use app\common\repositories\store\service\StoreServiceRepository; +use think\facade\Db; class StoreCategory extends BaseController { @@ -167,4 +168,13 @@ class StoreCategory extends BaseController $validate->check($data); return $data; } + + /** + * 分类 + */ + public function list_level($pid=0,$level=0){ + $select= Db::name('store_category')->where('pid',$pid)->where('level',$level)->where('is_show',1)->where('mer_id',0)->select(); + return app('json')->success($select); + + } } diff --git a/route/api.php b/route/api.php index 3e44955e..e47ccf46 100644 --- a/route/api.php +++ b/route/api.php @@ -35,6 +35,7 @@ Route::group('api/', function () { Route::get('region/goods', 'api.Auth/goodsStatistics'); Route::get('global/config', 'api.Auth/globalConfig'); Route::get('miniapp/version', 'api.Auth/miniAppVersion'); + Route::get('category/list_level', 'api.server.StoreCategory/list_level'); Route::resource('upload', 'api.Upload'); Route::post('articleCatch', 'api.Upload/article'); //强制登录