|
|
@@ -7,6 +7,7 @@ use biz\shop\classes\ShopClass;
|
|
|
use biz\sj\services\MerchantService;
|
|
|
use biz\wx\classes\WxMessageClass;
|
|
|
use bizGhs\custom\classes\CustomClass;
|
|
|
+use bizGhs\custom\classes\CustomDebtChangeClass;
|
|
|
use bizGhs\express\services\DadaExpressServices;
|
|
|
use bizGhs\order\classes\OrderClass;
|
|
|
use bizGhs\order\classes\RefundOrderClass;
|
|
|
@@ -46,6 +47,28 @@ class TestController extends BaseController
|
|
|
$ghsShopId = $ghs->shopId ?? 0;
|
|
|
$shop = ShopClass::getById($ghsShopId, true);
|
|
|
$mainId = $shop->mainId ?? 0;
|
|
|
+ $flag = [];
|
|
|
+ $changeList = CustomDebtChangeClass::getAllByCondition(['customId' => $customId], null, '*');
|
|
|
+ if (!empty($changeList)) {
|
|
|
+ foreach ($changeList as $change) {
|
|
|
+ $event = $change['evnet'] ?? '';
|
|
|
+ $capitalType = $change['capitalType'] ?? 0;
|
|
|
+ $relateId = $change['relateId'] ?? 0;
|
|
|
+ $amount = $change['amount'] ?? 0;
|
|
|
+ if ($capitalType == 40) {
|
|
|
+ if (strpos($event, '退款') === false) {
|
|
|
+ $flag['40-' . $relateId] = $amount;
|
|
|
+ } else {
|
|
|
+ $flag['33-' . $relateId] = $amount;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ $flag['20-' . $relateId] = $amount;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ print_r($flag);
|
|
|
+ die;
|
|
|
+ //40
|
|
|
$orderList = OrderClass::getAllByCondition(['customId' => $customId, 'debtPrice>' => 0], null, 'id,actPrice,payTime', null);
|
|
|
$arr = [];
|
|
|
if (!empty($orderList)) {
|
|
|
@@ -54,6 +77,7 @@ class TestController extends BaseController
|
|
|
$arr[$payTime] = $order;
|
|
|
}
|
|
|
}
|
|
|
+ //20
|
|
|
$clearList = PurchaseClearClass::getAllByCondition(['ghsShopId' => $ghsShopId, 'status' => 2], null, 'actPrice,payTime', null);
|
|
|
if (!empty($clearList)) {
|
|
|
foreach ($clearList as $clear) {
|
|
|
@@ -61,6 +85,7 @@ class TestController extends BaseController
|
|
|
$arr[$payTime] = $clear;
|
|
|
}
|
|
|
}
|
|
|
+ //33
|
|
|
$refundList = RefundOrderClass::getAllByCondition(['mainId' => $mainId], null, 'refundPrice,updateTime', null);
|
|
|
if (!empty($refundList)) {
|
|
|
foreach ($refundList as $refund) {
|