TestController.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. $info = Notification::orderBy('id', 'desc')->first();
  14. dd($info->sendOfficialInfo());
  15. return false;
  16. // $user = User::where('phone', '13438082119')->first();
  17. // User::where('phone', 'like', '%1343808211%')->update([
  18. // 'open_id' => $user->open_id,
  19. // 'union_id' => $user->union_id,
  20. // 'official_open_id' => $user->official_open_id
  21. // ]);
  22. // dd(User::where('phone', 'like', '%1343808211%')->pluck('union_id'));
  23. // $app = app('wechat.official_account.default');
  24. // $res = $app->template_message->send([
  25. // 'touser' => 'oEDlJ5p8EFuHepjBi0cASmHjb7Qg',
  26. // 'template_id' => 'dlRsvUWqeziBvGbdT89b69slvZll6gZVRCotIXCwwjM',
  27. // 'miniprogram' => [
  28. // 'appid' => 'xxxxxxx',
  29. // 'pagepath' => 'pages/xxx',
  30. // ],
  31. // 'data' => [
  32. // 'first' => '您有一条待审核的订单,请注意查看!',
  33. // 'keyword1' => '2010-01-01',
  34. // 'keyword2' => '设备租赁订单',
  35. // 'keyword3' => '待审核/机电负责人',
  36. // 'keyword4' => 'XX-项目',
  37. // 'keyword5' => 'XXXXXX',
  38. // 'remark' => '点击进入小程序查看详情,请及时处理。',
  39. // ],
  40. // ]);
  41. // dd($res);
  42. }
  43. }