Store the customized Shopro mall so it can be kept on the remote.

Co-authored-by: Cursor <cursoragent@cursor.com>
这个提交包含在:
wikiboss
2026-09-22 13:55:12 +08:00
当前提交 b87880e247
共有 2547 个文件被更改,包括 423496 次插入 和 0 次删除

查看文件

@@ -0,0 +1,90 @@
<?php
namespace app\admin\controller\shopro\user;
use app\admin\controller\shopro\Common;
use app\admin\model\shopro\user\WalletLog as WalletLogModel;
use addons\shopro\library\Operator;
class WalletLog extends Common
{
protected $model = null;
public function _initialize()
{
parent::_initialize();
$this->model = new WalletLogModel;
}
/**
* 余额记录
*/
public function money($id)
{
$list_rows = $this->request->param('list_rows', 10);
$walletLogs = WalletLogModel::where('user_id', $id)->money()->order('id', 'desc')->paginate($list_rows);
// 多态关联 oper
$morphs = [
'user' => \app\admin\model\shopro\user\User::class,
'admin' => \app\admin\model\Admin::class,
'system' => \app\admin\model\Admin::class,
];
$walletLogs = morph_to($walletLogs, $morphs, ['oper_type', 'oper_id']);
$walletLogs = $walletLogs->toArray();
// 解析操作人信息
foreach ($walletLogs['data'] as &$log) {
$log['oper'] = Operator::info($log['oper_type'], $log['oper'] ?? null);
}
$this->success('', null, $walletLogs);
}
/**
* 积分记录
*/
public function score($id)
{
$list_rows = $this->request->param('list_rows', 10);
$walletLogs = WalletLogModel::where('user_id', $id)->score()->order('id', 'desc')->paginate($list_rows);
// 多态关联 oper
$morphs = [
'user' => \app\admin\model\shopro\user\User::class,
'admin' => \app\admin\model\Admin::class,
'system' => \app\admin\model\Admin::class,
];
$walletLogs = morph_to($walletLogs, $morphs, ['oper_type', 'oper_id']);
$walletLogs = $walletLogs->toArray();
// 解析操作人信息
foreach ($walletLogs['data'] as &$log) {
$log['oper'] = Operator::info($log['oper_type'], $log['oper'] ?? null);
}
$this->success('', null, $walletLogs);
}
/**
* 佣金记录
*/
public function commission($id)
{
$list_rows = $this->request->param('list_rows', 10);
$walletLogs = WalletLogModel::where('user_id', $id)->commission()->order('id', 'desc')->paginate($list_rows);
// 多态关联 oper
$morphs = [
'user' => \app\admin\model\shopro\user\User::class,
'admin' => \app\admin\model\Admin::class,
'system' => \app\admin\model\Admin::class,
];
$walletLogs = morph_to($walletLogs, $morphs, ['oper_type', 'oper_id']);
$walletLogs = $walletLogs->toArray();
// 解析操作人信息
foreach ($walletLogs['data'] as &$log) {
$log['oper'] = Operator::info($log['oper_type'], $log['oper'] ?? null);
}
$this->success('', null, $walletLogs);
}
}