|
|
@@ -12,6 +12,33 @@ use Yii;
|
|
|
class TotalDebtChangeController extends Controller
|
|
|
{
|
|
|
|
|
|
+ // ./yii total-debt-change/ls
|
|
|
+ public function actionLs()
|
|
|
+ {
|
|
|
+ $list = ShopClass::getAllByCondition(['ptStyle' => 1], null, '*', null, true);
|
|
|
+ if (!empty($list)) {
|
|
|
+ foreach ($list as $shop) {
|
|
|
+ $shopId = $shop->id ?? 0;
|
|
|
+ $customList = \bizHd\custom\classes\CustomClass::getAllByCondition(['shopId' => $shopId], null, '*', null, true);
|
|
|
+ if (!empty($customList)) {
|
|
|
+ foreach ($customList as $custom) {
|
|
|
+ $customId = $custom->id ?? 0;
|
|
|
+ $lsOrderDebt = 0;
|
|
|
+ $lsOrderList = \bizHd\order\classes\OrderClass::getAllByCondition(['customId' => $customId], null, '*', null, true);
|
|
|
+ if (!empty($lsOrderList)) {
|
|
|
+ foreach ($lsOrderList as $lsOrder) {
|
|
|
+ $remainDebtPrice = $lsOrder->remainDebtPrice ?? 0;
|
|
|
+ $lsOrderDebt = bcadd($lsOrderDebt, $remainDebtPrice, 2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $custom->debtAmount = $lsOrderDebt;
|
|
|
+ $custom->save();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// ./yii total-debt-change/init
|
|
|
public function actionInit()
|
|
|
{
|