FmsWalletServices.php 1023 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. namespace App\Service\Fms;
  3. use App\Model\Telegram\TelegramBot;
  4. use App\Library\Log;
  5. use Hyperf\DbConnection\Db;
  6. class FmsWalletServices
  7. {
  8. /**
  9. * 获取机器人钱包列表
  10. * @param $type [0.读取 1.更新]
  11. */
  12. public function getList($type=0){
  13. $res = TelegramBot::select('rid','recharge_wallet_addr','get_tx_time')->whereNotNull('recharge_wallet_addr')->where('recharge_wallet_addr','like','T%')->whereRaw('length(recharge_wallet_addr) = 34')->orderBy('rid')->get();
  14. $data = array();
  15. if($res->count() > 0){
  16. $res = $res->toArray();
  17. foreach ($res as $key => $v) {
  18. $data[$v['rid']] = $v;
  19. }
  20. }
  21. return $res;
  22. }
  23. /**
  24. * 记入日志
  25. * @param $log_title [日志路径]
  26. * @param $message [内容,不支持数组]
  27. * @param $remarks [备注]
  28. */
  29. protected function log($log_title,$message,$remarks='info'){
  30. Log::get($remarks,$log_title)->info($message);
  31. }
  32. }