|
|
@@ -9,6 +9,7 @@ use biz\wx\classes\WxMessageClass;
|
|
|
use bizGhs\custom\classes\CustomClass;
|
|
|
use bizGhs\express\services\DadaExpressServices;
|
|
|
use bizGhs\order\classes\OrderClass;
|
|
|
+use bizGhs\order\classes\RefundOrderClass;
|
|
|
use bizHd\message\classes\InformAdminClass;
|
|
|
use bizHd\order\services\OrderService;
|
|
|
use bizHd\purchase\classes\PurchaseClass;
|
|
|
@@ -33,7 +34,7 @@ class TestController extends BaseController
|
|
|
//欠款的查询与跟踪 ssh 20240103
|
|
|
public function actionDebt()
|
|
|
{
|
|
|
- $customId = 1;
|
|
|
+ $customId = 591;
|
|
|
$custom = CustomClass::getById($customId, true);
|
|
|
if (empty($custom)) {
|
|
|
echo '没有找到客户';
|
|
|
@@ -42,14 +43,32 @@ class TestController extends BaseController
|
|
|
$ghsId = $custom->ghsId ?? 0;
|
|
|
$ghs = GhsClass::getById($ghsId, true);
|
|
|
$ghsShopId = $ghs->shopId ?? 0;
|
|
|
- $orderList = OrderClass::getAllByCondition(['customId' => $customId, 'debtPrice>' => 0], null, '*', null, true);
|
|
|
- if (empty($orderList)) {
|
|
|
- util::fail('没有找到订单');
|
|
|
+ $shop = ShopClass::getById($ghsShopId, true);
|
|
|
+ $mainId = $shop->mainId ?? 0;
|
|
|
+ $orderList = OrderClass::getAllByCondition(['customId' => $customId, 'debtPrice>' => 0], null, '*', null);
|
|
|
+ $arr = [];
|
|
|
+ if (!empty($orderList)) {
|
|
|
+ foreach ($orderList as $order) {
|
|
|
+ $payTime = $order['payTime'] ?? '';
|
|
|
+ $arr[$payTime] = $order;
|
|
|
+ }
|
|
|
}
|
|
|
- $clearList = PurchaseClearClass::getAllByCondition(['ghsShopId' => $ghsShopId, 'status' => 2]);
|
|
|
+ $clearList = PurchaseClearClass::getAllByCondition(['ghsShopId' => $ghsShopId, 'status' => 2], null, '*', null);
|
|
|
if (!empty($clearList)) {
|
|
|
-
|
|
|
+ foreach ($clearList as $clear) {
|
|
|
+ $payTime = $clear['payTime'] ?? '';
|
|
|
+ $arr[$payTime] = $clear;
|
|
|
+ }
|
|
|
}
|
|
|
+ $refundList = RefundOrderClass::getAllByCondition(['mainId' => $mainId], null, '*', null);
|
|
|
+ if (!empty($refundList)) {
|
|
|
+ foreach ($refundList as $refund) {
|
|
|
+ $updateTime = $refund['updateTime'] ?? '';
|
|
|
+ $arr[$updateTime] = $refund;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ echo "<pre>";
|
|
|
+ print_r($arr);
|
|
|
}
|
|
|
|
|
|
//退款操作 ssh 20231029
|