12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <?php
- namespace app\admin\controller\auth;
- use app\main\constants\AdminConstants;
- use app\main\service\AppGuideService;
- use think\Log;
- class Userordermoneysum extends UserDetailBase
- {
- public function _initialize()
- {
- parent::_initialize();
- }
- public function index()
- {
- $params = $this->request->param();
- $ids = $params['ids'];
- $pay = $params['pay'] ?? 0;
- if ($this->request->isAjax()) {
- list($where, $sort, $order, $offset, $limit) = $this->buildparams();
- if ($this->group == AdminConstants::ADMIN_GROUP_ID_CUSTOMER_SERVICE) {
- $where = ['user_id' => $ids];
- }else{
- $where = ['user_id' => $ids, 'deduct' => '0'];
- }
- if ($pay == 1) {
- $where['state'] = '0';
- }elseif($pay == 2){
- $where['state'] = '1';
- }
- $Czjl = model('Orders')->where($where)->order('id desc')->limit($offset, $limit)->select();
- $total = model('Orders')->where($where)->order('id desc')->count();
- if($Czjl){
- foreach($Czjl as $key=>$val){
- $Czjl[$key]['createtime'] = date('Y-m-d H:i:s', $val['createtime']);
- $Czjl[$key]['finishtime'] = date('Y-m-d H:i:s', $val['finishtime']);
- }
- }
- $result = array("total" => $total, "rows" => $Czjl);
- return json($result);
- }
- $this->view->assign('title', '订单记录');
- $this->view->assign('ids', $ids);
- $this->view->assign('pay', $pay);
- $this->view->assign('type', 'userordermoneysum');
- $this->assignconfig('ids', $ids);
- $this->assignconfig('pay', $pay);
- $isShowBusinessLine = true;
- if (in_array($this->group, [3, 4, 7, 8])) {
- $isShowBusinessLine = false;
- if (AppGuideService::instance()->isShowAdminMenu($this->auth->id)) {
- $isShowBusinessLine = true;
- }
- }
- $this->assignconfig('isShowBusinessLine', $isShowBusinessLine);
- return $this->view->fetch();
- }
- }
|