|
@@ -8,6 +8,7 @@ use SixShop\Lakala\Enum\ProfitShareOrderCMDTypeEnum;
|
|
|
use SixShop\Lakala\Enum\ProfitShareOrderStatusEnum;
|
|
use SixShop\Lakala\Enum\ProfitShareOrderStatusEnum;
|
|
|
use SixShop\Lakala\Enum\ReceiverStatusEnum;
|
|
use SixShop\Lakala\Enum\ReceiverStatusEnum;
|
|
|
use SixShop\Lakala\Facade\Config;
|
|
use SixShop\Lakala\Facade\Config;
|
|
|
|
|
+use SixShop\Lakala\Facade\LaepIndustryService;
|
|
|
use SixShop\Lakala\Facade\LedgerService;
|
|
use SixShop\Lakala\Facade\LedgerService;
|
|
|
use SixShop\Lakala\Model\ProfitShareOrderModel;
|
|
use SixShop\Lakala\Model\ProfitShareOrderModel;
|
|
|
use SixShop\Lakala\Model\ProfitShareReceiverModel;
|
|
use SixShop\Lakala\Model\ProfitShareReceiverModel;
|
|
@@ -95,12 +96,12 @@ class ProfitShareOrderEntity extends BaseEntity
|
|
|
$stats = $this->whereIn('status',['SUCCESS', 'PENDING'])->field([
|
|
$stats = $this->whereIn('status',['SUCCESS', 'PENDING'])->field([
|
|
|
"COALESCE(SUM(CASE WHEN status = 'SUCCESS' THEN total_amt ELSE 0 END), 0) AS total_amount", // 总分账金额
|
|
"COALESCE(SUM(CASE WHEN status = 'SUCCESS' THEN total_amt ELSE 0 END), 0) AS total_amount", // 总分账金额
|
|
|
"COALESCE(SUM(CASE WHEN status = 'SUCCESS' THEN separate_value ELSE 0 END), 0) AS user_total_amount", // 用户分账总金额
|
|
"COALESCE(SUM(CASE WHEN status = 'SUCCESS' THEN separate_value ELSE 0 END), 0) AS user_total_amount", // 用户分账总金额
|
|
|
- "COALESCE(SUM(CASE WHEN status = 'PENDING' THEN total_amt ELSE 0 END), 0) AS pending_amount", // 待分账总金额
|
|
|
|
|
|
|
+ "COALESCE(SUM(CASE WHEN status = 'PENDING' THEN separate_value ELSE 0 END), 0) AS user_pending_amount", // 用户待分账总金额
|
|
|
])->find();
|
|
])->find();
|
|
|
return [
|
|
return [
|
|
|
'total_amount' => (float)$stats['total_amount'],
|
|
'total_amount' => (float)$stats['total_amount'],
|
|
|
'user_total_amount' => (float)$stats['user_total_amount'],
|
|
'user_total_amount' => (float)$stats['user_total_amount'],
|
|
|
- 'pending_amount' => (float)$stats['pending_amount'],
|
|
|
|
|
|
|
+ 'user_pending_amount' => (float)$stats['user_pending_amount'],
|
|
|
];
|
|
];
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|