|
|
@@ -35,12 +35,11 @@ class StatCgController extends BaseController
|
|
|
$ghsProduct = [];
|
|
|
if ($showGhsParam == 1) {
|
|
|
$ghsId = $get['ghsId'] ?? 0;
|
|
|
- if (empty($ghsId)) {
|
|
|
- util::fail('请先选择供货商');
|
|
|
- }
|
|
|
$ghs = GhsClass::getById($ghsId, true);
|
|
|
- $ghsMainId = $ghs->mainId ?? 0;
|
|
|
- $ghsProduct = ProductClass::getAllByCondition(['mainId' => $ghsMainId, 'delStatus' => 0], null, 'id,name,itemId', 'itemId');
|
|
|
+ if (!empty($ghs)) {
|
|
|
+ $ghsMainId = $ghs->mainId ?? 0;
|
|
|
+ $ghsProduct = ProductClass::getAllByCondition(['mainId' => $ghsMainId, 'delStatus' => 0], null, 'id,name,itemId', 'itemId');
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
$list = PurchaseItemClass::getAllByCondition($where, null, '*');
|