|
|
@@ -17,7 +17,7 @@ class StatCgController extends BaseController
|
|
|
{
|
|
|
$get = Yii::$app->request->get();
|
|
|
$where = ['mainId' => $this->mainId];
|
|
|
- $searchTime = isset($get['searchTime']) && !empty($get['searchTime']) ? $get['searchTime'] : 'today';
|
|
|
+ $searchTime = !empty($get['searchTime']) ? $get['searchTime'] : 'today';
|
|
|
$startTime = $get['startTime'] ?? '';
|
|
|
$endTime = $get['endTime'] ?? '';
|
|
|
$period = dateUtil::formatTime($searchTime, $startTime, $endTime, true);
|
|
|
@@ -26,7 +26,7 @@ class StatCgController extends BaseController
|
|
|
$startDate = date("Y-m-d 00:00:00", strtotime($start));
|
|
|
$endDate = date("Y-m-d 23:59:59", strtotime($end));
|
|
|
$where['payTime'] = ['between', [$startDate, $endDate]];
|
|
|
- if (isset($get['ghsId']) && !empty($get['ghsId'])) {
|
|
|
+ if (!empty($get['ghsId'])) {
|
|
|
$where['ghsId'] = $get['ghsId'];
|
|
|
}
|
|
|
$list = PurchaseItemClass::getAllByCondition($where, null, '*');
|
|
|
@@ -53,8 +53,9 @@ class StatCgController extends BaseController
|
|
|
$amount = bcmul($num, $xhUnitPrice, 2);
|
|
|
$totalNum = bcadd($totalNum, $num, 2);
|
|
|
$totalAmount = bcadd($totalAmount, $amount, 2);
|
|
|
- $name = $productInfo[$productId]['name'] ?? '';
|
|
|
- $py = $productInfo[$productId]['py'] ?? '';
|
|
|
+ $myCurrentInfo = $productInfo[$productId]??[];
|
|
|
+ $name = $myCurrentInfo['name'] ?? '';
|
|
|
+ $py = $myCurrentInfo['py'] ?? '';
|
|
|
$stat[$productId]['productId'] = $productId;
|
|
|
$stat[$productId]['name'] = $name;
|
|
|
$stat[$productId]['py'] = $py;
|