From b21c74f103c1c31ece36d7d72df56bb4993c9969 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Sat, 22 Jun 2024 15:07:41 +0800 Subject: [PATCH] =?UTF-8?q?feat(IndexController):=20=E6=A0=B9=E6=8D=AEstor?= =?UTF-8?q?e=5Fid=E8=B0=83=E6=95=B4=E7=BB=9F=E8=AE=A1=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/statistics/controller/IndexController.php | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/app/statistics/controller/IndexController.php b/app/statistics/controller/IndexController.php index 040fc8193..d0ab4c5d4 100644 --- a/app/statistics/controller/IndexController.php +++ b/app/statistics/controller/IndexController.php @@ -11,9 +11,12 @@ use DateTime; class IndexController extends BaseLikeController { + public $store_id=3; + public function index() { - $res = OrderLogic::dayPayPrice(5); + $store_id = $this->store_id; + $res = OrderLogic::dayPayPrice($store_id); if (OrderLogic::hasError()) { return $this->fail(OrderLogic::getError()); //获取错误信息并返回错误信息 } @@ -32,7 +35,8 @@ class IndexController extends BaseLikeController $date = date('Y-m-d', $timestamp); $dates[]=$date; } - $res = UserLogic::userCount(5,$dates); + $store_id = $this->store_id; + $res = UserLogic::userCount($store_id,$dates); if (UserLogic::hasError()) { return $this->fail(UserLogic::getError()); //获取错误信息并返回错误信息 } @@ -44,7 +48,8 @@ class IndexController extends BaseLikeController */ public function product_count() { - $res = ProductLogic::Count(5); + $store_id = $this->store_id; + $res = ProductLogic::Count($store_id); if (ProductLogic::hasError()) { return $this->fail(ProductLogic::getError()); //获取错误信息并返回错误信息 } @@ -55,7 +60,8 @@ class IndexController extends BaseLikeController */ public function order_user_num_count() { - $res = OrderLogic::Count(5); + $store_id = $this->store_id; + $res = OrderLogic::Count($store_id); if (ProductLogic::hasError()) { return $this->fail(ProductLogic::getError()); //获取错误信息并返回错误信息 } @@ -66,7 +72,8 @@ class IndexController extends BaseLikeController */ public function sales_ranking() { - $res = ProductLogic::sales(5); + $store_id = $this->store_id; + $res = ProductLogic::sales($store_id); if (ProductLogic::hasError()) { return $this->fail(ProductLogic::getError()); //获取错误信息并返回错误信息 } @@ -87,7 +94,8 @@ class IndexController extends BaseLikeController $date->modify('+' . $i . ' days'); $dates[] = $date->format('Y-m-d'); } - $res = UserLogic::TradeCount(5, $dates); + $store_id = $this->store_id; + $res = UserLogic::TradeCount($store_id, $dates); if (UserLogic::hasError()) { return $this->fail(UserLogic::getError()); //获取错误信息并返回错误信息 } @@ -98,7 +106,8 @@ class IndexController extends BaseLikeController */ public function street_currday_order_count() { - $res = OrderLogic::Currday(5); + $store_id = $this->store_id; + $res = OrderLogic::Currday($store_id); if (ProductLogic::hasError()) { return $this->fail(ProductLogic::getError()); //获取错误信息并返回错误信息 }