|
|
@@ -298,6 +298,29 @@ class CustomClass extends BaseClass
|
|
|
$clear->save();
|
|
|
}
|
|
|
|
|
|
+ /** 供货商帮充与花店线上充:成对充值单互相关联,供余额明细展示结账单 */
|
|
|
+ protected static function linkCustomAndGhsRecharge($customRecharge, $ghsRecharge)
|
|
|
+ {
|
|
|
+ if (empty($customRecharge) || empty($ghsRecharge)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ $customRechargeId = intval(is_object($customRecharge) ? ($customRecharge->id ?? 0) : 0);
|
|
|
+ $ghsRechargeId = intval(is_object($ghsRecharge) ? ($ghsRecharge->id ?? 0) : 0);
|
|
|
+ if ($customRechargeId <= 0 || $ghsRechargeId <= 0) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ $cProbe = new \bizGhs\custom\models\CustomRecharge();
|
|
|
+ if (method_exists($cProbe, 'hasAttribute') && $cProbe->hasAttribute('ghsRechargeId')) {
|
|
|
+ $customRecharge->ghsRechargeId = $ghsRechargeId;
|
|
|
+ $customRecharge->save(false, ['ghsRechargeId']);
|
|
|
+ }
|
|
|
+ $gProbe = new \bizGhs\ghs\models\GhsRecharge();
|
|
|
+ if (method_exists($gProbe, 'hasAttribute') && $gProbe->hasAttribute('customRechargeId')) {
|
|
|
+ $ghsRecharge->customRechargeId = $customRechargeId;
|
|
|
+ $ghsRecharge->save(false, ['customRechargeId']);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// 充值/返充(增加净 balance);有多个地方要同步修改,请搜索关键词 custom_ghs_recharge ssh 20240310
|
|
|
public static function rechargeBalance($custom, $amount, $shop, $staff, $payWay, $params = [])
|
|
|
{
|
|
|
@@ -430,6 +453,7 @@ class CustomClass extends BaseClass
|
|
|
];
|
|
|
$gRecharge = GhsRechargeClass::add($gData, true);
|
|
|
$gRechargeId = $gRecharge->id ?? 0;
|
|
|
+ self::linkCustomAndGhsRecharge($cRecharge, $gRecharge);
|
|
|
$capitalType = dict::getDict('capitalType', 'customAskGhsRecharge', 'id');
|
|
|
if ($rechargeType == 1) {
|
|
|
//售后返充
|