Browse Source

修复首页banner

jason 7 months ago
parent
commit
00cd2a1217
2 changed files with 48 additions and 2 deletions
  1. 2 2
      application/api/controller/Home.php
  2. 46 0
      application/api/controller/Test.php

+ 2 - 2
application/api/controller/Home.php

@@ -44,7 +44,7 @@ class Home extends Api
             ->field('id,title as title,img_url,createtime')
             ->where('type_id', $announcement::Banner)
             ->where('status', $announcement::Normal)
-            ->where('to_lang', getLangKey($this->lan))
+            ->where('to_lang', $this->lan)
             ->limit(0,10)
             ->order('id DESC,weigh desc')
             ->select();
@@ -54,7 +54,7 @@ class Home extends Api
             ->field('id,title as title,img_url,createtime')
             ->where('type_id', $announcement::Announ)
             ->where('status', $announcement::Normal)
-            ->where('to_lang', getLangKey($this->lan))
+            ->where('to_lang', $this->lan)
             ->limit(0,10)
             ->order('id DESC,weigh desc')
             ->select();

+ 46 - 0
application/api/controller/Test.php

@@ -6,12 +6,14 @@ namespace app\api\controller;
 use app\common\logic\BscApi;
 use app\common\logic\MyBscApi;
 use app\common\logic\TeamRewards;
+use app\common\model\AnnouncementModel;
 use app\common\model\LedgerPowerChangeModel;
 use app\common\model\LedgerSmhChangeModel;
 use app\common\model\LedgerUsdtChangeModel;
 use app\common\model\OfflineRechargeRecordModel;
 use app\common\model\OfflineWithdrawRecordModel;
 use app\common\model\ParametersModel;
+use app\common\model\ProductOrder;
 use app\common\model\UserModel;
 use app\common\model\UserPathModel;
 use app\common\model\LedgerWalletModel;
@@ -610,4 +612,48 @@ class Test
         $body = (new MyBscApi())->getInfoByTransactionHash('0xc3fc59faa9a1a9ff4fa1516b7df10570876a87993c397f6cd33ce3446641b5b0');
         dump($body);
     }
+    public function resetAirdrop()
+    {
+        $order_list = (new ProductOrder())
+            ->where('type_id', 3)
+            ->group('user_id')
+            ->column('user_id');
+        dump($order_list);
+        $order_list_send = (new ProductOrder())
+            ->where('type_id', 4)
+            ->group('user_id')
+            ->column('user_id');
+        dump($order_list_send);
+        $order_list = array_diff($order_list, $order_list_send);
+        dump($order_list);
+        $rs = (new ProductOrder())
+            ->where('type_id', 3)
+            ->where('user_id', 'in', $order_list)
+            ->update([
+                'create_time' => 1744819200
+            ]);
+        dump($rs);
+    }
+
+    public function updateNews()
+    {
+        $en_news = DB::name('announcement_cope')->select();
+        foreach ($en_news as $info) {
+            if(strlen($info['en_title']) > 3){
+                $rs = (new AnnouncementModel())
+                    ->save([
+                        'type_id' => $info['type_id'],
+                        'title' => $info['en_body'],
+                        'introduction' => $info['en_introduction'],
+                        'body' => $info['en_body'],
+                        'img_url' => $info['img_url'],
+                        'to_lang' => 1,
+                        'status' => $info['status'],
+                        'created_by' => $info['created_by'],
+                        'createtime' => $info['createtime'],
+                    ]);
+            }
+        }
+        dump($rs);
+    }
 }