|
@@ -49,11 +49,15 @@ class GhsPurchaseBalanceMergeController extends Controller
|
|
|
|
|
|
|
|
$count = 0;
|
|
$count = 0;
|
|
|
$purchasePtStyles = $this->getGhsAppPurchasePtStyles();
|
|
$purchasePtStyles = $this->getGhsAppPurchasePtStyles();
|
|
|
- $where = ['and', ['>', 'ownShopId', 0], ['in', 'ownPtStyle', $purchasePtStyles]];
|
|
|
|
|
|
|
+ // 本项目 conditionQuery 只支持哈希条件,不支持 Yii 的 ['and', ...] 写法
|
|
|
|
|
+ $where = [
|
|
|
|
|
+ 'ownShopId>' => 0,
|
|
|
|
|
+ 'ownPtStyle' => ['in', $purchasePtStyles],
|
|
|
|
|
+ ];
|
|
|
if ($this->columnExists('xhGhs', 'balanceMerged')) {
|
|
if ($this->columnExists('xhGhs', 'balanceMerged')) {
|
|
|
- $where = ['and', ['>', 'ownShopId', 0], ['in', 'ownPtStyle', $purchasePtStyles], ['balanceMerged' => 0]];
|
|
|
|
|
|
|
+ $where['balanceMerged'] = 0;
|
|
|
} else {
|
|
} else {
|
|
|
- $where = ['and', ['>', 'ownShopId', 0], ['in', 'ownPtStyle', $purchasePtStyles], ['>', 'debtAmount', 0]];
|
|
|
|
|
|
|
+ $where['debtAmount>'] = 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
$list = BizGhsClass::getAllByCondition($where, null, 'id,ownShopId,ownPtStyle,balance,debtAmount,balanceMerged', null, true);
|
|
$list = BizGhsClass::getAllByCondition($where, null, 'id,ownShopId,ownPtStyle,balance,debtAmount,balanceMerged', null, true);
|
|
@@ -64,9 +68,12 @@ class GhsPurchaseBalanceMergeController extends Controller
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// ownPtStyle 未回填的历史行:再扫 ownPtStyle=0,由 isGhsAppPurchaseSupplierRow 按门店 ptStyle 判定
|
|
// ownPtStyle 未回填的历史行:再扫 ownPtStyle=0,由 isGhsAppPurchaseSupplierRow 按门店 ptStyle 判定
|
|
|
- $legacyWhere = ['and', ['>', 'ownShopId', 0], ['ownPtStyle' => 0]];
|
|
|
|
|
|
|
+ $legacyWhere = [
|
|
|
|
|
+ 'ownShopId>' => 0,
|
|
|
|
|
+ 'ownPtStyle' => 0,
|
|
|
|
|
+ ];
|
|
|
if ($this->columnExists('xhGhs', 'balanceMerged')) {
|
|
if ($this->columnExists('xhGhs', 'balanceMerged')) {
|
|
|
- $legacyWhere = ['and', ['>', 'ownShopId', 0], ['ownPtStyle' => 0], ['balanceMerged' => 0]];
|
|
|
|
|
|
|
+ $legacyWhere['balanceMerged'] = 0;
|
|
|
}
|
|
}
|
|
|
$legacyList = BizGhsClass::getAllByCondition($legacyWhere, null, 'id,ownShopId,ownPtStyle,balance,debtAmount,balanceMerged', null, true);
|
|
$legacyList = BizGhsClass::getAllByCondition($legacyWhere, null, 'id,ownShopId,ownPtStyle,balance,debtAmount,balanceMerged', null, true);
|
|
|
foreach ($legacyList as $ghs) {
|
|
foreach ($legacyList as $ghs) {
|