Index.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <?php
  2. namespace app\index\controller;
  3. use app\index\service\DaKaService;
  4. use app\index\service\RiBaoService;
  5. use think\Db;
  6. use think\Validate;
  7. class Index
  8. {
  9. public function index()
  10. {
  11. return 'index';
  12. }
  13. public function chatInfo() {
  14. }
  15. public function sendChatMsg() {
  16. $params = input();
  17. $rules = [
  18. 'userId' => 'require',
  19. 'otherUserId' => 'require',
  20. 'content' => 'require'
  21. ];
  22. new Validate($params);
  23. }
  24. public function chatList() {
  25. }
  26. public function hello($name = 'ThinkPHP5')
  27. {
  28. return 'hello,' . $name;
  29. }
  30. public function daka() {
  31. $service = new DaKaService();
  32. $service->run();
  33. }
  34. public function ribao() {
  35. $data = [
  36. 'msgtype' => 'text',
  37. 'text' => [
  38. 'content' => '汇报日报了各位大佬(已写的请忽略)'
  39. ]
  40. ];
  41. $date = date('Y-m-d');
  42. var_dump($date);
  43. $hm = date('H:i');
  44. $w = date('w', strtotime($date));
  45. if($w==6 || $w == 0){
  46. var_dump($date . '周末,跳过');
  47. die();
  48. }
  49. if ($hm !== '22:30') {
  50. var_dump('不是期望时间不提示');
  51. die();
  52. }
  53. $riBao = new RiBaoService();
  54. $riBao->sendMsg($data);
  55. }
  56. }