request; if ($retuest->isAjax) { if ($retuest->isPost) { $post = Yii::$app->request->post(); // 检查提交的参数 $res = Yii::$app->services->validate->validate($post,[ [['id','level'], 'integer'], [['out_trade_no','date_end','date_start'], 'safe'], [['limit'],'default','value' => '15'], ]); if($res === false) return $this->error(Yii::$app->services->validate->getErrorMessage()); $post = PlatformFinanceLog::exceptNullVal($post); if($post['date_start'] && $post['date_end']) $where[] = ['between', 'created_at', strtotime($post['date_start']),strtotime($post['date_end'])]; if($post['out_trade_no']) $where[] = ['like', 'out_trade_no', $post['out_trade_no']]; $where[] = ['>=','status',StatusEnum::DISABLED]; $order = 'id desc'; $params = array('where' => $where, 'order'=>$order, 'limit' => $post['limit']); $list = PlatformFinanceLog::listPage($params, false, true); $select = 'sum(add_money) as add_money,sum(sub_money) as sub_money'; $statics = PlatformFinanceDay::getOne('',true,'','id desc',$select); $list['statistics'] = $statics; $list['change_type'] = PlatformEnum::getChangeTypeMap(); $list['from_type'] = PlatformEnum::getFromTypeMap(); $list['payment_type'] = PayTypeEnum::getMap(); $this->success('获取成功', $list); } } else { return $this->render($this->action->id); } } }