[积分商城]优化对接API

This commit is contained in:
2026-03-30 11:47:32 +08:00
parent b30ef21780
commit 4a42899bfe
55 changed files with 835 additions and 1241 deletions

View File

@@ -2,7 +2,6 @@
namespace app\admin\controller\mall;
use Throwable;
use app\common\controller\Backend;
use support\Response;
use Webman\Http\Request;
@@ -20,12 +19,17 @@ class PlayxUserAsset extends Backend
protected array|string $preExcludeFields = ['id', 'create_time', 'update_time'];
protected string|array $quickSearchField = ['user_id', 'username'];
protected string|array $quickSearchField = [
'playx_user_id',
'username',
'phone',
];
protected string|array $indexField = [
'id',
'user_id',
'playx_user_id',
'username',
'phone',
'locked_points',
'available_points',
'today_limit',
@@ -42,17 +46,36 @@ class PlayxUserAsset extends Backend
}
/**
* 查看
* @throws Throwable
* 远程下拉:资产主键 id + 用户名(用于地址/订单等关联)
*/
public function index(Request $request): Response
public function select(Request $request): Response
{
$response = $this->initializeBackend($request);
if ($response !== null) {
return $response;
}
return $this->_index();
list($where, $alias, $limit, $order) = $this->queryBuilder();
$res = $this->model
->field('id,username')
->alias($alias)
->where($where)
->order($order)
->paginate($limit);
$list = [];
foreach ($res->items() as $row) {
$arr = $row->toArray();
$list[] = [
'id' => intval($arr['id'] ?? 0),
'username' => strval($arr['username'] ?? ''),
];
}
return $this->success('', [
'list' => $list,
'total' => $res->total(),
'remark' => get_route_remark(),
]);
}
}