gamebackend/application/admin/controller/EquipController.php

54 lines
1.7 KiB
PHP
Raw Normal View History

2025-04-24 18:13:33 +08:00
<?php
// +----------------------------------------------------------------------
// | 作者:修缘 联系QQ278896498 QQ群1054861244
// | 声明:未经作者许可,禁止倒卖等商业运营,违者必究
// | 另接php业务网站制作、代理后台、gm后台、支付对接等
// +----------------------------------------------------------------------
// | 创建时间: 2022/1/1 2:54
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\common\model\Equip;
use think\Db;
use think\db\Connection;
use think\facade\Config;
use think\Request;
class EquipController extends Controller
{
protected function initialize(): void
{
parent::initialize(); // TODO: Change the autogenerated stub
$this->get_son_agency_account();
}
public function index(Equip $model, Request $request)
{
$param = $request->param();
// $son_agency_invite = $this->son_agency_invite . ",{$this->user->invite}";
$model = $model
->field('EquipID,EquipType,RoleID,Grade,create_time,name,BaseScore,pos')
->order('RoleID');
// ->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();
}
}