|
|
@@ -553,22 +553,14 @@ class PurchaseOrderController extends BaseController
|
|
|
public function actionDueList()
|
|
|
{
|
|
|
$get = Yii::$app->request->get();
|
|
|
- $where = [];
|
|
|
$mainId = $this->mainId;
|
|
|
- $debt = isset($get['debt']) && is_numeric($get['debt']) ? $get['debt'] : -1;
|
|
|
- $where['mainId'] = $mainId;
|
|
|
+ $debt = isset($get['debt']) && is_numeric($get['debt']) ? $get['debt'] : 0;
|
|
|
$searchTime = isset($get['searchTime']) && !empty($get['searchTime']) ? $get['searchTime'] : 'today';
|
|
|
-
|
|
|
$startTime = $get['startTime'] ?? '';
|
|
|
$endTime = $get['endTime'] ?? '';
|
|
|
$period = dateUtil::formatTime($searchTime, $startTime, $endTime, true);
|
|
|
$start = $period['startTime'];
|
|
|
$end = $period['endTime'];
|
|
|
- $where['time'] = ['between', [$start, $end]];
|
|
|
- if ($debt > -1) {
|
|
|
- $where['debt'] = $debt;
|
|
|
- }
|
|
|
-
|
|
|
$ghsList = GhsClass::getAllByCondition(['ownShopId' => $this->shopId], null, 'id,name', 'id');
|
|
|
$currentStartDate = date('Y-m-d', strtotime($start));
|
|
|
$currentEndDate = date('Y-m-d', strtotime($end));
|
|
|
@@ -576,6 +568,9 @@ class PurchaseOrderController extends BaseController
|
|
|
$currentEndTime = $currentEndDate . ' 23:59:59';
|
|
|
|
|
|
$cgWhere = ['mainId' => $mainId, 'status' => 4];
|
|
|
+ if ($debt > 0) {
|
|
|
+ $cgWhere['debt'] = $debt;
|
|
|
+ }
|
|
|
$cgWhere['entryTime'] = ['between', [$currentStartTime, $currentEndTime]];
|
|
|
$cgList = PurchaseOrderClass::getAllByCondition($cgWhere, null, '*');
|
|
|
$list = [];
|