|
|
@@ -0,0 +1,118 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+namespace backendApi\modules\v1\models\lists\shop;
|
|
|
+
|
|
|
+use common\helpers\Cache;
|
|
|
+use common\helpers\user\Info;
|
|
|
+use common\libs\dataList\column\Price;
|
|
|
+use common\libs\dataList\DataListInterface;
|
|
|
+use common\libs\dataList\column\DateTime;
|
|
|
+use common\models\FlowRemainPv;
|
|
|
+use Yii;
|
|
|
+
|
|
|
+class FlowRemainPvList extends \common\libs\dataList\DataList implements DataListInterface {
|
|
|
+ /**
|
|
|
+ * 列表名称
|
|
|
+ * @return string
|
|
|
+ */
|
|
|
+ public function getListName() {
|
|
|
+ return '剩余BV流水';
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 列表筛选到的数据
|
|
|
+ * @throws \yii\base\Exception
|
|
|
+ */
|
|
|
+ public function dataHandle() {
|
|
|
+ $this->listData = FlowRemainPv::lists($this->condition, $this->params, [
|
|
|
+ 'select' => 'FR.*,U.USER_NAME,U.REAL_NAME,U.IS_DEC',
|
|
|
+ 'orderBy' => 'FR.UPDATED_AT DESC,FR.ID DESC',
|
|
|
+ 'from' => FlowRemainPv::tableName() . ' AS FR',
|
|
|
+ 'join' => [
|
|
|
+ ['LEFT JOIN', \common\models\User::tableName() . ' AS U', 'FR.USER_ID=U.ID'],
|
|
|
+ ],
|
|
|
+ 'page' => $this->page,
|
|
|
+ 'pageSize' => $this->pageSize,
|
|
|
+ ]);
|
|
|
+ foreach ($this->listData['list'] as $key => $value) {
|
|
|
+// $this->listData['list'][$key]['LAST_STATUS_NAME'] = \Yii::$app->params['userStatus'][$value['LAST_STATUS']]['label'] ?? '';
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 要展示和导出的所有字段
|
|
|
+ * @return array
|
|
|
+ */
|
|
|
+ public function getColumn() {
|
|
|
+ if (!$this->columns) {
|
|
|
+ $this->columns = [
|
|
|
+ 'ID' => null,
|
|
|
+ 'PERIOD_NUM' => [
|
|
|
+ 'header' => 'Period Number', // 期数
|
|
|
+ 'headerOther' => [
|
|
|
+ 'width' => '150',
|
|
|
+ ],
|
|
|
+ ],
|
|
|
+ 'USER_NAME' => [
|
|
|
+ 'header' => 'Member code',//会员编号
|
|
|
+ 'headerOther' => [
|
|
|
+ 'width' => '150',
|
|
|
+ ],
|
|
|
+ 'valueOther' => [
|
|
|
+ 'tag' => ['type' => 'info', 'size' => 'small', 'class' => 'no-border']
|
|
|
+ ],
|
|
|
+ ],
|
|
|
+ 'REAL_NAME' => [
|
|
|
+ 'header' => 'Member name',//会员姓名
|
|
|
+ 'headerOther' => [
|
|
|
+ 'width' => '120',
|
|
|
+ ],
|
|
|
+ 'valueOther' => [
|
|
|
+ 'tag' => ['type' => 'success', 'size' => 'small', 'class' => 'no-border']
|
|
|
+ ],
|
|
|
+ ],
|
|
|
+ 'REMAIN_PV_FLOW' => [
|
|
|
+ 'header' => 'Remain Pv Flow',
|
|
|
+ 'headerOther' => [
|
|
|
+ 'width' => '150',
|
|
|
+ 'prop' => 'REMAIN_PV_FLOW',
|
|
|
+ ],
|
|
|
+ ],
|
|
|
+ 'REMAIN_PV_TOTAL' => [
|
|
|
+ 'header' => 'Remain Pv Total',
|
|
|
+ 'headerOther' => [
|
|
|
+ 'width' => '150',
|
|
|
+ 'prop' => 'REMAIN_PV_TOTAL',
|
|
|
+ ],
|
|
|
+ ],
|
|
|
+ 'UPDATED_AT' => [
|
|
|
+ 'header' => 'Updated Time',//创建时间
|
|
|
+ 'value' => function ($row) {
|
|
|
+ return (new DateTime([
|
|
|
+ 'value' => $row['UPDATED_AT'],
|
|
|
+ ]))->result();
|
|
|
+ },
|
|
|
+ 'headerOther' => ['width' => '170'],
|
|
|
+ ],
|
|
|
+ ];
|
|
|
+ }
|
|
|
+ return $this->columns;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 前台用于筛选的类型集合
|
|
|
+ * @return mixed
|
|
|
+ */
|
|
|
+ public function getFilterTypes() {
|
|
|
+ if (!$this->filterTypes) {
|
|
|
+ $this->filterTypes = [
|
|
|
+ 'UPDATED_AT' => ['isUserTable' => false, 'name' => 'Updated Time', 'other' => 'date'], // 创建时间
|
|
|
+ 'PERIOD_NUM' => ['isUserTable' => false, 'name' => 'Period Number'], // 期数
|
|
|
+ 'USER_NAME' => ['isUserTable' => false, 'name' => 'Member Code'], // 会员编号
|
|
|
+ 'REAL_NAME' => ['isUserTable' => false, 'name' => 'Member Name'], // 会员姓名
|
|
|
+ ];
|
|
|
+ }
|
|
|
+ return $this->filterTypes;
|
|
|
+ }
|
|
|
+}
|