Quellcode durchsuchen

feat: EK-2806: 会员端Promo和banner图增加分国家设置.

kevin vor 4 Monaten
Ursprung
Commit
124f49021d
1 geänderte Dateien mit 14 neuen und 52 gelöschten Zeilen
  1. 14 52
      backendApi/modules/v1/models/lists/ad/AdIndexList.php

+ 14 - 52
backendApi/modules/v1/models/lists/ad/AdIndexList.php

@@ -43,6 +43,14 @@ class AdIndexList extends \common\libs\dataList\DataList implements DataListInte
                     'headerOther' => ['width' => '150'],
                 ],
                 'COUNTRY_NAME' => null,
+                'LID' => [
+                    'label' => '广告位',
+                    'type' => function($data){
+                        $value = $data['value'];
+                        $adLocation = AdLocation::findOneAsArray('ID=:ID', [':ID'=>$value], 'LOCATION_NAME');
+                        return $adLocation['LOCATION_NAME'];
+                    },
+                ],
                 'STATUS' => [
                     'header' => Yii::t('ctx', 'status'),
                     'headerOther' => ['width' => '100'],
@@ -59,56 +67,10 @@ class AdIndexList extends \common\libs\dataList\DataList implements DataListInte
                 ],
             ];
         }
-        
+
         return $this->columns;
     }
 
-//    public function getColumn(){
-//        if(!$this->columns){
-//            $this->columns = [
-//                'ID' => null,
-//                'TITLE' => null,
-//                'COUNTRY_ID' => [
-//                    'header' => Yii::t('ctx', 'country'),
-//                    'headerOther' => ['width' => '150'],
-//                ],
-////                'TYPE' => null,
-////                'TYPE_NAME' => [
-////                    'label' => '类型',
-////                    'type' => function($data){
-////                        $value = $data['value'];
-////                        return $value==1 ? 'External Link' : 'Article';
-////                    },
-////                ],
-//                'LID' => [
-//                    'label' => '广告位',
-//                    'type' => function($data){
-//                        $value = $data['value'];
-//                        $adLocation = AdLocation::findOneAsArray('ID=:ID', [':ID'=>$value], 'LOCATION_NAME');
-//                        return $adLocation['LOCATION_NAME'];
-//                    },
-//                ],
-////                'CONTENT' => null,
-//                'COUNTRY_NAME' => null,
-//                'STATUS' => [
-//                    'header' => Yii::t('ctx', 'status'),
-//                    'headerOther' => ['width' => '100'],
-//                ],
-//                'SORT' => null,
-//                'CREATED_AT' => [
-//                    'header' => Yii::t('ctx', 'createTime'),
-//                    'value' => function($row) {
-//                        return (new DateTime([
-//                            'value' => $row['CREATED_AT'],
-//                        ]))->result();
-//                    },
-//                    'headerOther' => ['width' => '180'],
-//                ],
-//            ];
-//        }
-//        return $this->columns;
-//    }
-
     /**
      * 前台用于筛选的类型集合
      * @return mixed
@@ -120,11 +82,11 @@ class AdIndexList extends \common\libs\dataList\DataList implements DataListInte
                 'TITLE'=> ['name'=> Yii::t('ctx', 'title')],
                 'CONTENT' => ['name'=> Yii::t('ctx', 'content')],
                 // 确保这里的键名与getColumn()方法中的列名一致
-//                'COUNTRY_ID'=> [
-//                    'name'=> \Yii::t('ctx', 'country'),
-//                    'other'=> 'select',
-//                    'selectData'=> self::getCountry()
-//                ],
+                'COUNTRY'=> [
+                    'name'=> \Yii::t('ctx', 'country'),
+                    'other'=> 'select',
+                    'selectData'=> self::getCountry()
+                ],
                 'STATUS'=> [
                     'name'=> Yii::t('ctx', 'status'),
                     'other'=> 'select',