| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- <?php
- namespace app\admin\controller\informational;
- use app\common\model\ShopCategory;
- use app\admin\traits\Curd;
- use app\common\controller\AdminController;
- use app\common\model\WithDrawLogModel;
- use app\common\model\XzLogModel;
- use EasyAdmin\annotation\ControllerAnnotation;
- use EasyAdmin\annotation\NodeAnotation;
- use think\App;
- use think\facade\Db;
- use think\Model;
- /**
- * (业务已取消)
- * Class Admin
- * @package app\admin\controller\system
- * @ControllerAnnotation(title="星钻转赠记录")
- */
- class Xzlog extends AdminController
- {
- use Curd;
- public function __construct (App $app, XzLogModel $model)
- {
- parent::__construct($app);
- $this->model = $model;
- }
- /**
- * 提现列表
- * @return mixed|\think\response\Json
- * @throws \think\db\exception\DataNotFoundException
- * @throws \think\db\exception\DbException
- * @throws \think\db\exception\ModelNotFoundException
- */
- public function index ()
- {
- if ($this->request->isAjax()) {
- if (input('selectFields')) {
- return $this->selectList();
- }
- list($page, $limit, $where) = $this->buildTableParames();
- foreach ($where as $key=>$val){
- if ($val[0] == 'status'){
- $where[$key][0] = 'o.status';
- }
- if ($val[0] == 'create_at'){
- $where[$key][0] = 'create_at';
- $where[$key][2] = sr_getcurtime($where[$key][2]);
- }
- }
- $count = $this->model
- ->where('type', 'in',[6])
- ->withJoin('user', 'INNER')
- ->where($this->user_map)
- ->where($where)
- ->count();
- $list = $this->model
- ->where('type', 'in',[6])
- ->withJoin('user', 'INNER')
- ->where($this->user_map)
- ->where($where)
- ->page($page, $limit)
- ->order($this->sort)
- ->select();
- foreach ($list as $key=>$val){
- $list[$key]['mobile2'] = Db::name('user')->where('id', $val['uid2'])->value('mobile');
- }
- $data = [
- 'code' => 0,
- 'msg' => '',
- 'count' => $count,
- 'data' => $list,
- ];
- return json($data);
- }
- return $this->fetch();
- }
- }
|