paginate([ 'list_rows' => 20, 'query' => request()->param() ]); return json($list); } // 菜单 public function getMenuList(){ $list = Db::table('zxc_menu')->where('pid',0)->select()->toArray(); foreach ($list as $key=>&$value){ $value['title'] = $value['name']; $value['children'] = Db::table('zxc_menu')->where('pid',$value['id'])->select()->toArray(); if(!empty($value['children'])){ foreach ($value['children'] as $kk =>&$vv){ $vv['title'] = $vv['name']; } } } return json($list); } // 优惠券相关 public function getCouponList(){ $where = []; $list = Db::table('zxc_coupon') ->paginate([ 'list_rows' => 20, 'query' => request()->param() ]); return json($list); } // 获取日志 public function getLogList(){ $where = []; $list = Db::table('system_request_logs') ->order('id desc') ->paginate([ 'list_rows' => 20, 'query' => request()->param() ]); return json($list); } //运营数据 public function getYunYingData(){ return json([]); } //财务数据 public function getCaiWuData(){ $where = []; $list = Db::table('zxc_user_money_log') ->order('id desc') ->paginate([ 'list_rows' => 20, 'query' => request()->param() ]); $typeMap = [ '1'=>'充电订单', '2'=>'充值', '3'=>'提现' ]; $list->each(function($item, $key) use ($typeMap) { $item['type_text'] = $typeMap[$item['type']]; return $item; }); return json($list); } }