|
@@ -24,6 +24,7 @@ use app\model\SysSerial;
|
|
|
use app\model\SysUser;
|
|
|
use support\Db;
|
|
|
use support\exception\BusinessException;
|
|
|
+use support\Log;
|
|
|
use support\Request;
|
|
|
use support\Response;
|
|
|
|
|
@@ -957,7 +958,7 @@ class MemberService
|
|
|
// ->toArray();
|
|
|
|
|
|
$memberAccountList = MemberAccountList::where('join_member_account_list_member_id', $memberId)
|
|
|
- ->where('member_account_list_status','ACTIVED')
|
|
|
+ ->where('member_account_list_status', 'ACTIVED')
|
|
|
->selectRaw('
|
|
|
member_account_list_extend_json as join_pay_object_json,
|
|
|
join_member_account_list_member_id as join_pay_member_id,
|
|
@@ -1026,7 +1027,7 @@ class MemberService
|
|
|
$item['balance_type'] = 'cut';
|
|
|
}
|
|
|
if ($key == 0 && in_array($item['pay_category'], ['RECHARGE', 'REFUND', 'GIVE'])) {
|
|
|
- if (!empty($item['pay_extend_json']) && !in_array($item['join_pay_order_id'],['PARTNER', 'COMBINE'])) {
|
|
|
+ if (!empty($item['pay_extend_json']) && !in_array($item['join_pay_order_id'], ['PARTNER', 'COMBINE'])) {
|
|
|
$extendJson = json_decode($item['pay_extend_json'], true);
|
|
|
if (!isset($extendJson['added_amount'])) {
|
|
|
$extendJson['added_amount'] = 0;
|
|
@@ -1047,7 +1048,7 @@ class MemberService
|
|
|
}
|
|
|
$balance = $balance - $extendJson['added_amount'];
|
|
|
}
|
|
|
- if (in_array($item['join_pay_order_id'],['PARTNER', 'COMBINE'])){
|
|
|
+ if (in_array($item['join_pay_order_id'], ['PARTNER', 'COMBINE'])) {
|
|
|
$addedAmount = 0;
|
|
|
if (!isset($payObjectJson['recharge_config'])) {
|
|
|
$addedAmount = 0;
|
|
@@ -1076,7 +1077,7 @@ class MemberService
|
|
|
}
|
|
|
|
|
|
if (in_array($item['pay_category'], ['RECHARGE', 'REFUND', 'GIVE', 'PARTNER', 'COMBINE', 'IN'])) {
|
|
|
- if (!empty($item['pay_extend_json']) && !in_array($item['join_pay_order_id'],['PARTNER', 'COMBINE'])) {
|
|
|
+ if (!empty($item['pay_extend_json']) && !in_array($item['join_pay_order_id'], ['PARTNER', 'COMBINE'])) {
|
|
|
$extendJson = json_decode($item['pay_extend_json'], true);
|
|
|
if (isset($extendJson['added_amount']) && floatval($extendJson['added_amount']) > 0) {
|
|
|
$data[] = [
|
|
@@ -1090,7 +1091,7 @@ class MemberService
|
|
|
$balance = $balance - $extendJson['added_amount'];
|
|
|
}
|
|
|
}
|
|
|
- if (in_array($item['join_pay_order_id'],['PARTNER', 'COMBINE'])){
|
|
|
+ if (in_array($item['join_pay_order_id'], ['PARTNER', 'COMBINE'])) {
|
|
|
$addedAmount = 0;
|
|
|
if (!isset($payObjectJson['recharge_config'])) {
|
|
|
$addedAmount = 0;
|
|
@@ -1136,7 +1137,7 @@ class MemberService
|
|
|
return json_fail('暂无数据');
|
|
|
}
|
|
|
$balance = $account->member_account_surplus + $account->member_account_added;
|
|
|
- $points = ClientPoints::where('join_client_points_member_id', $memberId)->orderBy('client_points_addtimes','DESC')->get()->toArray();
|
|
|
+ $points = ClientPoints::where('join_client_points_member_id', $memberId)->orderBy('client_points_addtimes', 'DESC')->get()->toArray();
|
|
|
$nowPoint = 0;
|
|
|
foreach ($points as $key => &$point) {
|
|
|
$point['goods_category'] = '其他';
|
|
@@ -1708,4 +1709,34 @@ class MemberService
|
|
|
return 'NON';
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @Desc 会员合伙人过期
|
|
|
+ * @Author Gorden
|
|
|
+ * @Date 2024/10/10 9:50
|
|
|
+ *
|
|
|
+ * @return void
|
|
|
+ */
|
|
|
+ public static function partnerExpired()
|
|
|
+ {
|
|
|
+ $members = Member::where('member_is_partner', 'Y')->get()->toArray();
|
|
|
+ foreach ($members as $member) {
|
|
|
+ $partnerJson = [];
|
|
|
+ if (!empty($member['member_partner_json'])) {
|
|
|
+ $partnerJson = json_decode($member['member_partner_json'], true);
|
|
|
+ }
|
|
|
+ if (isset($partnerJson['duedate'])) {
|
|
|
+ $duedateUnix = strtotime($partnerJson['duedate'] . ' 23:59:59');
|
|
|
+ if ($duedateUnix > time()) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ Member::where('member_id', $member['member_id'])->update(['member_is_partner' => 'N', 'member_partner_json' => '[]']);
|
|
|
+
|
|
|
+ _syslog("会员合伙人过期", "取消身份", false, $partnerJson, 1001);
|
|
|
+
|
|
|
+ Log::info("会员【" . $member['member_id'] . '】会员合伙人身份已过期', $partnerJson);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|