seven 3 днів тому
батько
коміт
183a4be60f
1 змінених файлів з 60 додано та 59 видалено
  1. 60 59
      app/Services/SanJinRechargeService.php

+ 60 - 59
app/Services/SanJinRechargeService.php

@@ -22,11 +22,11 @@ class SanJinRechargeService
      */
     public static function init(Api $telegram, $data, $chatId, $firstName, $messageId)
     {
-        //点击三斤提现按钮
-        if ($data === "withdraw@@qb_apply") {
-            $res = SanJinRechargeService::qbApply($chatId, $messageId);
-            $telegram->editMessageText($res);
-        }
+        // //点击三斤提现按钮
+        // if ($data === "withdraw@@qb_apply") {
+        //     $res = SanJinRechargeService::qbApply($chatId, $messageId);
+        //     $telegram->editMessageText($res);
+        // }
 
 
         //三斤账单
@@ -40,54 +40,54 @@ class SanJinRechargeService
         }
 
 
-        //选择银行卡号
-        $pattern = "/^withdrawAddress@@choose_qb_\d+$/";
-        if (preg_match($pattern, $data)) {
-            $id = preg_replace('/^withdrawAddress@@choose_qb_/', '', $data);
-            $res = SanJinRechargeService::chooseBank($chatId, $id);
-            $telegram->deleteMessage([
-                'chat_id' => $chatId,
-                'message_id' => $messageId,
-            ]);
-            $telegram->sendMessage($res);
-        }
-
-
-        //银行卡管理
-        if ($data === 'withdraw@@banks') {
-            $res = SanJinRechargeService::banks($chatId, $messageId);
-            $telegram->editMessageText($res);
-        }
-
-
-        //银行卡详情
-        $pattern = "/^withdrawAddress@@bank_detail\d+$/";
-        if (preg_match($pattern, $data)) {
-            $id = preg_replace('/^withdrawAddress@@bank_detail/', '', $data);
-            $res = static::bankDetails($chatId, $messageId, $id);
-            $telegram->editMessageText($res);
-        }
-
-        $pattern = "/^withdraw@@bank_del_\d+$/";
-        if (preg_match($pattern, $data)) {
-            $id = preg_replace('/^withdraw@@bank_del_/', '', $data);
-            $res = static::bankDelete($chatId, $messageId, $id);
-            $telegram->editMessageText($res);
-        }
-
-
-        //添加银行卡
-        if ($data === "withdrawAddress@@bank_add") {
-            $res = SanJinRechargeService::addBank($chatId, $messageId);
-            $telegram->editMessageText($res);
-        }
-
-        $pattern = "/^withdrawAddress@@bank_choose_channel_.*$/";
-        if (preg_match($pattern, $data)) {
-            $channel = preg_replace('/^withdrawAddress@@bank_choose_channel_/', '', $data);
-            $res = static::chooseChannel($chatId, $messageId, $channel);
-            $telegram->editMessageText($res);
-        }
+        // //选择银行卡号
+        // $pattern = "/^withdrawAddress@@choose_qb_\d+$/";
+        // if (preg_match($pattern, $data)) {
+        //     $id = preg_replace('/^withdrawAddress@@choose_qb_/', '', $data);
+        //     $res = SanJinRechargeService::chooseBank($chatId, $id);
+        //     $telegram->deleteMessage([
+        //         'chat_id' => $chatId,
+        //         'message_id' => $messageId,
+        //     ]);
+        //     $telegram->sendMessage($res);
+        // }
+
+
+        // //银行卡管理
+        // if ($data === 'withdraw@@banks') {
+        //     $res = SanJinRechargeService::banks($chatId, $messageId);
+        //     $telegram->editMessageText($res);
+        // }
+
+
+        // //银行卡详情
+        // $pattern = "/^withdrawAddress@@bank_detail\d+$/";
+        // if (preg_match($pattern, $data)) {
+        //     $id = preg_replace('/^withdrawAddress@@bank_detail/', '', $data);
+        //     $res = static::bankDetails($chatId, $messageId, $id);
+        //     $telegram->editMessageText($res);
+        // }
+
+        // $pattern = "/^withdraw@@bank_del_\d+$/";
+        // if (preg_match($pattern, $data)) {
+        //     $id = preg_replace('/^withdraw@@bank_del_/', '', $data);
+        //     $res = static::bankDelete($chatId, $messageId, $id);
+        //     $telegram->editMessageText($res);
+        // }
+
+
+        // //添加银行卡
+        // if ($data === "withdrawAddress@@bank_add") {
+        //     $res = SanJinRechargeService::addBank($chatId, $messageId);
+        //     $telegram->editMessageText($res);
+        // }
+
+        // $pattern = "/^withdrawAddress@@bank_choose_channel_.*$/";
+        // if (preg_match($pattern, $data)) {
+        //     $channel = preg_replace('/^withdrawAddress@@bank_choose_channel_/', '', $data);
+        //     $res = static::chooseChannel($chatId, $messageId, $channel);
+        //     $telegram->editMessageText($res);
+        // }
 
 
     }
@@ -136,10 +136,11 @@ class SanJinRechargeService
             $text .= "-------------------------------------\n";
             $text .= "{$amount} \n";
             $text .= "订单号:{$item->order_no}\n";
+            $text .= "支付金额:{$item->amo}\n";
 
-            $text .= "银行:{$item->bank_name}\n";
-            $text .= "姓名:{$item->account}\n";
-            $text .= "卡号:{$item->card_no}\n";
+            // $text .= "银行:{$item->bank_name}\n";
+            // $text .= "姓名:{$item->account}\n";
+            // $text .= "卡号:{$item->card_no}\n";
             $status = ['待处理', '处理中', '成功', '失败'];
             $text .= "状态:{$status[$item->status]}\n";
             if ($item->remark) {
@@ -150,16 +151,16 @@ class SanJinRechargeService
 
         if ($page > 1) {
             $keyboard[] = [
-                ['text' => "👆上一页", 'callback_data' => "withdraw@@bank_bill_" . ($page - 1)]
+                ['text' => "👆上一页", 'callback_data' => "topup@@sj_bill_" . ($page - 1)]
             ];
         }
         $allPage = ceil($count / $limit);
         if ($allPage > $page) {
             if ($page > 1) {
-                $keyboard[count($keyboard) - 1][] = ['text' => "👇下一页", 'callback_data' => "withdraw@@bank_bill_" . ($page + 1)];
+                $keyboard[count($keyboard) - 1][] = ['text' => "👇下一页", 'callback_data' => "topup@@sj_bill_" . ($page + 1)];
             } else {
                 $keyboard[] = [
-                    ['text' => "👇下一页", 'callback_data' => "withdraw@@bank_bill_" . ($page + 1)]
+                    ['text' => "👇下一页", 'callback_data' => "topup@@sj_bill_" . ($page + 1)]
                 ];
             }
         }