更新接口不通过user_id绑定数据
This commit is contained in:
13
app/admin/lang/en/mall/points_log.php
Normal file
13
app/admin/lang/en/mall/points_log.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'User asset' => 'User asset',
|
||||
'Points adjustment' => 'Points adjustment',
|
||||
'User asset not found' => 'User asset not found',
|
||||
'Points adjustment must be a non-zero integer' => 'Points adjustment must be a non-zero integer',
|
||||
'Insufficient available points' => 'Insufficient available points',
|
||||
'Administrator added %s points' => 'Administrator added %s points',
|
||||
'Administrator deducted %s points' => 'Administrator deducted %s points',
|
||||
'Points log cannot be modified' => 'Points log cannot be modified',
|
||||
'Points log cannot be deleted' => 'Points log cannot be deleted',
|
||||
];
|
||||
13
app/admin/lang/zh-cn/mall/points_log.php
Normal file
13
app/admin/lang/zh-cn/mall/points_log.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'User asset' => '用户资产',
|
||||
'Points adjustment' => '调整积分',
|
||||
'User asset not found' => '用户资产不存在',
|
||||
'Points adjustment must be a non-zero integer' => '调整积分必须为非零整数',
|
||||
'Insufficient available points' => '可用积分不足',
|
||||
'Administrator added %s points' => '管理员增加积分 %s',
|
||||
'Administrator deducted %s points' => '管理员扣除积分 %s',
|
||||
'Points log cannot be modified' => '积分流水不允许修改',
|
||||
'Points log cannot be deleted' => '积分流水不允许删除',
|
||||
];
|
||||
@@ -28,7 +28,7 @@ use support\Response;
|
||||
class Playx extends Api
|
||||
{
|
||||
/**
|
||||
* 从请求解析 mall_user_asset.id(muser token、session、user_id 均指向资产表主键或 playx_user_id)
|
||||
* 从请求解析 mall_user_asset.id(muser token 或 mall_session)
|
||||
*/
|
||||
private function resolvePlayxAssetIdFromRequest(Request $request): ?int
|
||||
{
|
||||
@@ -58,19 +58,6 @@ class Playx extends Api
|
||||
return $this->resolveAssetIdByToken($token);
|
||||
}
|
||||
|
||||
$userId = strval($request->post('user_id', $request->get('user_id', '')));
|
||||
if ($userId === '') {
|
||||
return null;
|
||||
}
|
||||
if (ctype_digit($userId)) {
|
||||
return intval($userId);
|
||||
}
|
||||
|
||||
$asset = MallUserAsset::where('playx_user_id', $userId)->find();
|
||||
if ($asset) {
|
||||
return intval($asset->getKey());
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -683,7 +670,7 @@ class Playx extends Api
|
||||
|
||||
/**
|
||||
* 用户资产
|
||||
* GET /api/v1/playx/assets?user_id=xxx
|
||||
* GET /api/v1/mall/assets
|
||||
*/
|
||||
public function assets(Request $request): Response
|
||||
{
|
||||
@@ -846,7 +833,7 @@ class Playx extends Api
|
||||
|
||||
/**
|
||||
* 订单列表
|
||||
* GET /api/v1/playx/orders?user_id=xxx
|
||||
* GET /api/v1/mall/orders
|
||||
*/
|
||||
public function orders(Request $request): Response
|
||||
{
|
||||
@@ -885,7 +872,7 @@ class Playx extends Api
|
||||
* 按订单 ID 查询订单(仅当前登录用户本人的订单)
|
||||
* GET /api/v1/mall/order?order_id=xxx
|
||||
*
|
||||
* 鉴权:token / session_id / user_id(同 assets/orders)
|
||||
* 鉴权:token / session_id(同 assets/orders)
|
||||
*/
|
||||
public function order(Request $request): Response
|
||||
{
|
||||
@@ -936,7 +923,7 @@ class Playx extends Api
|
||||
* 积分流水(领取/兑换/退回/管理员调整)
|
||||
* GET /api/v1/mall/pointsLogs
|
||||
*
|
||||
* 鉴权:token / session_id / user_id(同 assets/orders)
|
||||
* 鉴权:token / session_id(同 assets/orders)
|
||||
*
|
||||
* 参数:
|
||||
* - limit: 每页条数(默认 20,最大 100)
|
||||
|
||||
@@ -72,11 +72,11 @@ return [
|
||||
'Daily push signature missing or incomplete' => 'Daily push signature missing or incomplete',
|
||||
'Daily push signature verification failed' => 'Daily push signature verification failed',
|
||||
'Failed to ensure PlayX user asset' => 'Failed to ensure PlayX user asset',
|
||||
'claim_request_id and user_id/session_id required' => 'claim_request_id and user_id/session_id/token are required',
|
||||
'claim_request_id and user_id/session_id required' => 'claim_request_id and session_id/token are required',
|
||||
'User asset not found' => 'User asset not found',
|
||||
'No points to claim or limit reached' => 'No points to claim or daily limit reached',
|
||||
'Claim success' => 'Claim successful',
|
||||
'item_id and user_id/session_id required' => 'item_id and user_id/session_id/token are required',
|
||||
'item_id and user_id/session_id required' => 'item_id and 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',
|
||||
|
||||
@@ -73,11 +73,11 @@ return [
|
||||
'Daily push signature missing or incomplete' => 'Tandatangan push harian tiada atau tidak lengkap',
|
||||
'Daily push signature verification failed' => 'Pengesahan tandatangan push harian gagal',
|
||||
'Failed to ensure PlayX user asset' => 'Gagal mencipta/memeta aset pengguna',
|
||||
'claim_request_id and user_id/session_id required' => 'claim_request_id dan user_id/session_id/token diperlukan',
|
||||
'claim_request_id and user_id/session_id required' => 'claim_request_id dan session_id/token diperlukan',
|
||||
'User asset not found' => 'Aset pengguna tidak dijumpai',
|
||||
'No points to claim or limit reached' => 'Tiada mata untuk dituntut atau had harian dicapai',
|
||||
'Claim success' => 'Tuntutan berjaya',
|
||||
'item_id and user_id/session_id required' => 'item_id dan user_id/session_id/token diperlukan',
|
||||
'item_id and user_id/session_id required' => 'item_id dan 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',
|
||||
|
||||
@@ -74,11 +74,11 @@ return [
|
||||
'Daily push signature missing or incomplete' => '签名缺失或不完整',
|
||||
'Daily push signature verification failed' => '签名校验失败',
|
||||
'Failed to ensure PlayX user asset' => '创建/映射用户资产失败',
|
||||
'claim_request_id and user_id/session_id required' => '缺少 claim_request_id,或未提供有效的 user_id/session_id/token',
|
||||
'claim_request_id and user_id/session_id required' => '缺少 claim_request_id,或未提供有效的 session_id/token',
|
||||
'User asset not found' => '未找到用户资产',
|
||||
'No points to claim or limit reached' => '暂无可领取积分或已达今日上限',
|
||||
'Claim success' => '领取成功',
|
||||
'item_id and user_id/session_id required' => '缺少 item_id,或未提供有效的 user_id/session_id/token',
|
||||
'item_id and user_id/session_id required' => '缺少 item_id,或未提供有效的 session_id/token',
|
||||
'Item not found or not available' => '商品不存在或已下架',
|
||||
'Insufficient points' => '积分不足',
|
||||
'Administrator added %s points' => '管理员增加积分 %s',
|
||||
|
||||
Reference in New Issue
Block a user