HuaWeiController.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. /**
  3. * ${CARET}
  4. * @file:HuaWeiController.php
  5. * @Created by gnitif
  6. * @Date: 2023/2/6
  7. * @Time: 15:40
  8. */
  9. namespace App\Http\Controllers\QuickApp;
  10. use App\Http\Controllers\Controller;
  11. use App\Modules\Subscribe\Services\ChapterOrderService;
  12. use App\Modules\User\Services\ReadRecordService;
  13. use Illuminate\Support\Facades\DB;
  14. class HuaWeiController extends Controller
  15. {
  16. public function index(){
  17. set_time_limit(0);
  18. //
  19. // die();
  20. $sql = "SELECT id,send_order_id,balance,created_at FROM users WHERE send_order_id in (4007118,4007706,4007708,4007731,4007733,4007793,4007834,4007843,4009806,4012429,4016127,4023097) and LENGTH(openid) > 32 AND created_at > '2023-02-2' and balance > 0 and balance < 100;";
  21. // $sql = "SELECT id,send_order_id,balance,created_at FROM users WHERE 1 limit 10";
  22. $uids = DB::select($sql);
  23. if(!is_empty($uids)){
  24. foreach ($uids as $v){
  25. $res = ReadRecordService::getReadRecord($v->id);
  26. if (is_empty($res)){
  27. $res = array_column($res,null,'bid');
  28. $res = $res[66643] ?? [];
  29. }
  30. if (!is_empty($res)){
  31. if (isset($res['cid']) && $v->id > 0 && in_array($res['cid'],[30300728,30300727,30300726,30300725,30300724,30300723] )){
  32. ReadRecordService::delReadRecordStatic($v->id, [66643]);
  33. }
  34. }
  35. // $res = ReadRecordService::getReadRecord(1234598187);
  36. echo "<pre><hr> uid => ".$v->id."\t 书币:{$v->balance} \t 注册时间:{$v->created_at} \t 阅读书籍本数:".count($res)."<br> ";
  37. // var_export($res);
  38. }
  39. }
  40. }
  41. }