TestController.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. namespace App\Http\Controllers\Admin;
  3. use App\Models\Notification;
  4. use App\Models\Project;
  5. use App\Models\User;
  6. use App\Models\UserAuth;
  7. use App\Models\WorkPoint;
  8. use Illuminate\Http\Request;
  9. class TestController extends Controller
  10. {
  11. public function index(Request $request)
  12. {
  13. // dd(mb_substr('你好', 0, 1));
  14. // $info = Notification::orderBy('id', 'desc')->first();
  15. // dd($info->sendOfficialInfo());
  16. // return false;
  17. // $user = User::where('phone', '18980623975')->first();
  18. // User::where('phone', 'like', '%1343808211%')->update([
  19. // 'open_id' => $user->open_id,
  20. // 'union_id' => $user->union_id,
  21. // 'official_open_id' => $user->official_open_id
  22. // ]);
  23. // dd(User::where('phone', 'like', '%18980623975%')->first());
  24. // $open_id=User::where('phone', 'like', '%18980623975%')->pluck('open_id');
  25. // // dd($open_id[0]);
  26. // $content = [
  27. // 'name' => '租赁审批成功通知',
  28. // 'content' => '你的设备租赁申请已通过,请确认相关信息:',
  29. // 'official' => [
  30. // 'template_id' => 'dlRsvUWqeziBvGbdT89b69slvZll6gZVRCotIXCwwjM',
  31. // 'page' => 'pages/order-detail/index?id=1',
  32. // 'data' => [
  33. // 'first' => '您有一个订单已通过审核,请注意查看!',
  34. // 'keyword1' => '',
  35. // 'keyword2' => '',
  36. // 'keyword3' => '',
  37. // 'keyword4' => '',
  38. // 'keyword5' => '',
  39. // 'remark' => '点击进入小程序查看详情。',
  40. // ]
  41. // ]
  42. // ];
  43. // $info = $content['official'];
  44. // $official_app = app('wechat.mini_program.default');
  45. // $res = $official_app->uniform_message->send([
  46. // 'touser' => $open_id[0],
  47. // 'mp_template_msg' => [
  48. // 'appid'=>env('WECHAT_OFFICIAL_ACCOUNT_APPID'),
  49. // 'template_id' => $info['template_id'],
  50. // 'miniprogram' => [
  51. // 'appid' => env('WECHAT_MINI_PROGRAM_APPID'),
  52. // 'pagepath' => $info['page'],
  53. // ],
  54. // 'data' => $info['data'],
  55. // ]
  56. // ]);
  57. // dd($res);
  58. }
  59. }