ith5 4 hónapja
szülő
commit
2f5e23a261

+ 20 - 0
app/v1/logic/advert/AgentSiteLogic.php

@@ -86,6 +86,26 @@ class AgentSiteLogic extends BaseLogic
         return $data;
     }
 
+    /**
+     * 新增广告位
+     */
+    public function add($data): mixed
+    {
+        $insertData = [];
+        
+        for($i=0;$i<$data['num'];$i++){
+            $insertData[] = [
+                'media_id' => $data['media_id'],
+                'agent_id' => $data['agent_id'],
+                'auth_id' => $data['auth_id'],
+                'name' => $data['name'].$i,
+            ];
+        }
+        echo 'insertData:'.json_encode($insertData);
+        $this->model->insertAll($insertData);
+        return true;
+    }
+
     /**
      * 获取头条媒体配置
      */

+ 1 - 1
app/v1/logic/advert/GamePackageLogic.php

@@ -25,7 +25,7 @@ class GamePackageLogic extends BaseLogic
      */
     public function getPackageOptions($where = [])
     {
-        $data = $this->model->where($where)->select()->toArray();
+        $data = $this->model->where($where)->order('id', 'desc')->select()->toArray();
         return $data;
     }
 

+ 4 - 0
app/v1/logic/advert/MediaCostLogic.php

@@ -18,6 +18,8 @@ class MediaCostLogic extends BaseLogic
     protected $agentListLogic;
     protected $gameLogic;
     protected $systemUserLogic;
+
+    
     /**
      * 构造函数
      */
@@ -28,6 +30,8 @@ class MediaCostLogic extends BaseLogic
         $this->agentListLogic = new AgentListLogic();
         $this->gameLogic = new GameLogic();
         $this->systemUserLogic = new SystemUserLogic();
+        $this->setOrderField('tdate');
+        $this->setOrderType('desc');
     }
 
 

+ 3 - 2
app/v1/logic/center/GameLogic.php

@@ -27,6 +27,7 @@ class GameLogic extends BaseLogic
         $this->gameMainLogic = new GameMainLogic();
         $this->systemDeptLogic = new SystemDeptLogic();
         $this->gameGroupLogic = new GameGroupLogic();
+       
     }
 
     /**
@@ -36,17 +37,17 @@ class GameLogic extends BaseLogic
      */
     public function getIndex($where)
     {
-        // $authGameList = request()->header('auth_game_list');
         $userAuthCache = new UserInfoCache(getCurrentInfo()['id']);
         $userInfo = $userAuthCache->getUserInfo();
         
         $authGameList = $userInfo['deptList']['game_list'];
+
         $query = $this->search($where);
         if(!empty($authGameList) && $authGameList!='*') {
             $authGameList = explode(',', $authGameList);
             $query->where('id', 'in', $authGameList);
         }
-        $query->order('sort', 'desc');
+        $query->order('id', 'asc');
 
         $data = $this->getList($query);