|
|
@@ -56,7 +56,10 @@ class ConsoleController extends BaseController
|
|
|
public function actionProfile()
|
|
|
{
|
|
|
$mainId = $this->mainId;
|
|
|
- $respond = \bizGhs\stat\classes\StatSaleClass::profile($mainId);
|
|
|
+
|
|
|
+ //--------- 今日的收入、订单和客户 ---------
|
|
|
+ $respond = StatSaleClass::profile($mainId);
|
|
|
+ $orderNum = $respond['totalOrderNum'] ?? 0;
|
|
|
$incomeList = $respond['income'] ?? [];
|
|
|
$todaySale = 0;
|
|
|
if (!empty($incomeList)) {
|
|
|
@@ -69,15 +72,14 @@ class ConsoleController extends BaseController
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- $orderNum = $respond['totalOrderNum'] ?? 0;
|
|
|
-
|
|
|
//访客数
|
|
|
$visitCustom = StatVisitClass::getVisitNum($this->shopId);
|
|
|
$wastage = \bizGhs\order\classes\StockWastageOrderClass::getTodayWaste($this->mainId);
|
|
|
|
|
|
$hsReturn = StatOrderClass::statHsNum($this->mainId);
|
|
|
$hsNum = $hsReturn['num'] ?? 0;
|
|
|
- $mainId = $this->mainId;
|
|
|
+
|
|
|
+ //--------- 昨日的收入、订单和客户 ---------
|
|
|
$_GET['searchTime'] = 'yesterday'; // 必须要有的,让其获取昨天的收入
|
|
|
$respond = StatSaleClass::profile($mainId);
|
|
|
$incomeList = $respond['income'] ?? [];
|
|
|
@@ -91,6 +93,10 @@ class ConsoleController extends BaseController
|
|
|
$yesterdayIncome = bcadd($yesterdayIncome, $item['amount'], 2);
|
|
|
}
|
|
|
}
|
|
|
+ $yesterdayOrderNum = $respond['totalOrderNum'] ?? 0;
|
|
|
+ $yesterdayVisitCustom = StatVisitClass::getVisitNum($this->shopId, date("Ymd", strtotime("-1 day")));
|
|
|
+
|
|
|
+
|
|
|
$menu = [
|
|
|
["name" => "商城", "img" => "ghs/home/shop2.png", "url" => "/admin/cg/mall", 'pf' => 1,],
|
|
|
["name" => "改价", "img" => "ghs/home/gj2.png", "url" => "/admin/changePrice/list2", 'pf' => 1,],
|
|
|
@@ -104,10 +110,8 @@ class ConsoleController extends BaseController
|
|
|
["name" => "花束", "img" => "ghs/home/kcyjs2.png", "url" => "/admin/goods/list", 'pf' => 1,],
|
|
|
["name" => "客户充值", "img" => "ghs/home/kcyjs2.png", "url" => "/admin/recharge/rechargeCode", 'pf' => 1,],
|
|
|
];
|
|
|
-
|
|
|
//查看财务的权限
|
|
|
$lookMoney = \bizGhs\shop\classes\ShopAdminClass::lookMoneyPower($this->shopAdmin, $this->shop);
|
|
|
-
|
|
|
$warning = '';
|
|
|
//$warning = '本月4号凌晨4点~5点系统升级,暂停使用';
|
|
|
|
|
|
@@ -122,8 +126,11 @@ class ConsoleController extends BaseController
|
|
|
'wastage' => $wastage,
|
|
|
'bouquet' => $hsNum
|
|
|
],
|
|
|
- 'incomeStat' => [],
|
|
|
- 'yesterdayIncome' => $yesterdayIncome,
|
|
|
+ 'yesterdayData' => [
|
|
|
+ 'visit' => $yesterdayVisitCustom,
|
|
|
+ 'income' => $yesterdayIncome,
|
|
|
+ 'order' => $yesterdayOrderNum
|
|
|
+ ],
|
|
|
'menu' => $menu,
|
|
|
'lookMoney' => $lookMoney,
|
|
|
]);
|