54 lines
1.7 KiB
PHP
54 lines
1.7 KiB
PHP
<?php
|
||
// +----------------------------------------------------------------------
|
||
// | 作者:修缘 联系QQ:278896498 QQ群:1054861244
|
||
// | 声明:未经作者许可,禁止倒卖等商业运营,违者必究
|
||
// | 另接php业务,网站制作、代理后台、gm后台、支付对接等
|
||
// +----------------------------------------------------------------------
|
||
// | 创建时间: 2022/1/1 2:54
|
||
// +----------------------------------------------------------------------
|
||
|
||
|
||
namespace app\admin\controller;
|
||
|
||
|
||
use app\common\model\Player;
|
||
use think\Db;
|
||
use think\db\Connection;
|
||
use think\facade\Config;
|
||
use think\Request;
|
||
|
||
class PlayerController extends Controller
|
||
{
|
||
protected function initialize(): void
|
||
{
|
||
parent::initialize(); // TODO: Change the autogenerated stub
|
||
$this->get_son_agency_account();
|
||
}
|
||
|
||
public function index(Player $model, Request $request)
|
||
{
|
||
|
||
$param = $request->param();
|
||
$son_agency_invite = $this->son_agency_invite . ",{$this->user->invite}";
|
||
$model = $model
|
||
->field('roleid,name,accountid,level,jade,create_time,serverid,mapid,x,y,lastonline')
|
||
->order('create_time')
|
||
|
||
->withJoin([
|
||
'account' => function ($query) use($son_agency_invite) {
|
||
$query->whereIn('invite', $son_agency_invite);
|
||
}
|
||
])->scope('where', $param);
|
||
$data = $model->paginate($this->admin['per_page'], false, ['query' => $request->get()]);
|
||
// dump($data);
|
||
$this->assign($request->get());
|
||
$this->assign([
|
||
'data' => $data->toArray()['data'],
|
||
'page' => $data->render(),
|
||
'total' => $data->total(),
|
||
]);
|
||
return $this->fetch();
|
||
|
||
}
|
||
|
||
} |