增加积分调整日志
This commit is contained in:
@@ -847,7 +847,7 @@ class Playx extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* 积分流水(领取/兑换/退回)
|
||||
* 积分流水(领取/兑换/退回/管理员调整)
|
||||
* GET /api/v1/mall/pointsLogs
|
||||
*
|
||||
* 鉴权:token / session_id / user_id(同 assets/orders)
|
||||
@@ -981,6 +981,28 @@ FROM (
|
||||
FROM mall_order o
|
||||
LEFT JOIN mall_item i ON i.id = o.mall_item_id
|
||||
WHERE o.user_id = :user_id_refund AND o.status = 'REJECTED' AND o.points_cost > 0 AND o.update_time IS NOT NULL
|
||||
|
||||
UNION ALL
|
||||
|
||||
SELECT
|
||||
'ADMIN_ADJUST' AS biz_type,
|
||||
CASE WHEN pl.score_value > 0 THEN 'IN' ELSE 'OUT' END AS direction,
|
||||
ABS(pl.score_value) AS points,
|
||||
pl.create_time AS ts,
|
||||
pl.id AS ref_id,
|
||||
'' AS order_no,
|
||||
'' AS order_status,
|
||||
0 AS item_id,
|
||||
'' AS item_title,
|
||||
0 AS item_type,
|
||||
0 AS item_score,
|
||||
0 AS item_amount,
|
||||
0 AS item_multiplier,
|
||||
'' AS item_category,
|
||||
'' AS item_category_title,
|
||||
CONCAT(LPAD(pl.create_time, 10, '0'), '_4_', LPAD(pl.id, 10, '0')) AS sort_key
|
||||
FROM mall_points_log pl
|
||||
WHERE pl.user_asset_id = :user_asset_id_adjust
|
||||
) t
|
||||
WHERE 1=1
|
||||
SQL;
|
||||
@@ -989,6 +1011,7 @@ SQL;
|
||||
'user_id_claim' => $playxUserId,
|
||||
'user_id_redeem' => $playxUserId,
|
||||
'user_id_refund' => $playxUserId,
|
||||
'user_asset_id_adjust' => $assetId,
|
||||
];
|
||||
|
||||
if ($cursor !== '') {
|
||||
@@ -1016,10 +1039,18 @@ SQL;
|
||||
if (!is_array($row)) {
|
||||
continue;
|
||||
}
|
||||
$memo = '';
|
||||
if (($row['biz_type'] ?? '') === 'ADMIN_ADJUST') {
|
||||
$memoKey = ($row['direction'] ?? '') === 'OUT'
|
||||
? 'Administrator deducted %s points'
|
||||
: 'Administrator added %s points';
|
||||
$memo = __($memoKey, [$row['points'] ?? 0]);
|
||||
}
|
||||
$list[] = [
|
||||
'biz_type' => $row['biz_type'] ?? '',
|
||||
'direction' => $row['direction'] ?? '',
|
||||
'points' => $row['points'] ?? 0,
|
||||
'memo' => $memo,
|
||||
'ts' => $row['ts'] ?? null,
|
||||
'ref_id' => $row['ref_id'] ?? '',
|
||||
'order_no' => $row['order_no'] ?? '',
|
||||
|
||||
@@ -78,6 +78,8 @@ return [
|
||||
'item_id and user_id/session_id required' => 'item_id and user_id/session_id/token are required',
|
||||
'Item not found or not available' => 'Item not found or not available',
|
||||
'Insufficient points' => 'Insufficient points',
|
||||
'Administrator added %s points' => 'Administrator added %s points',
|
||||
'Administrator deducted %s points' => 'Administrator deducted %s points',
|
||||
'Redeem submitted, please wait about 10 minutes' => 'Redeem submitted, please wait about 10 minutes',
|
||||
'Missing required fields' => 'Missing required fields',
|
||||
'Out of stock' => 'Out of stock',
|
||||
|
||||
@@ -79,6 +79,8 @@ return [
|
||||
'item_id and user_id/session_id required' => 'item_id dan user_id/session_id/token diperlukan',
|
||||
'Item not found or not available' => 'Item tidak dijumpai atau tidak tersedia',
|
||||
'Insufficient points' => 'Mata tidak mencukupi',
|
||||
'Administrator added %s points' => 'Pentadbir menambah %s mata',
|
||||
'Administrator deducted %s points' => 'Pentadbir menolak %s mata',
|
||||
'Redeem submitted, please wait about 10 minutes' => 'Penebusan dihantar, sila tunggu kira-kira 10 minit',
|
||||
'Missing required fields' => 'Medan wajib tiada',
|
||||
'Out of stock' => 'Stok tidak mencukupi',
|
||||
|
||||
@@ -80,6 +80,8 @@ return [
|
||||
'item_id and user_id/session_id required' => '缺少 item_id,或未提供有效的 user_id/session_id/token',
|
||||
'Item not found or not available' => '商品不存在或已下架',
|
||||
'Insufficient points' => '积分不足',
|
||||
'Administrator added %s points' => '管理员增加积分 %s',
|
||||
'Administrator deducted %s points' => '管理员扣除积分 %s',
|
||||
'Redeem submitted, please wait about 10 minutes' => '兑换已提交,请等待约 10 分钟',
|
||||
'Missing required fields' => '缺少必填字段',
|
||||
'Out of stock' => '库存不足',
|
||||
|
||||
Reference in New Issue
Block a user