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()); //获取错误信息并返回错误信息 }