mirror of
https://gitee.com/wonderful-code/buildadmin
synced 2024-11-23 07:40:18 +00:00
43 lines
879 B
PHP
43 lines
879 B
PHP
<?php
|
|
|
|
namespace app\admin\controller\user;
|
|
|
|
use app\common\controller\Backend;
|
|
use app\admin\model\UserMoneyLog;
|
|
use app\admin\model\User;
|
|
|
|
class MoneyLog extends Backend
|
|
{
|
|
protected $model = null;
|
|
|
|
protected $withJoinTable = ['user'];
|
|
|
|
// 排除字段
|
|
protected $preExcludeFields = ['createtime'];
|
|
|
|
protected $quickSearchField = ['user.username', 'user.nickname'];
|
|
|
|
public function initialize()
|
|
{
|
|
parent::initialize();
|
|
$this->model = new UserMoneyLog();
|
|
}
|
|
|
|
/**
|
|
* 添加
|
|
*/
|
|
public function add($userId = 0)
|
|
{
|
|
if ($this->request->isPost()) {
|
|
parent::add();
|
|
}
|
|
|
|
$user = User::where('id', (int)$userId)->find();
|
|
if (!$user) {
|
|
$this->error(__("The user can't find it"));
|
|
}
|
|
$this->success('', [
|
|
'user' => $user
|
|
]);
|
|
}
|
|
} |