Index.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. $hm = date('H:i');
  43. var_dump($date.' '.$hm);
  44. $w = date('w', strtotime($date));
  45. if($w==6 || $w == 0){
  46. var_dump($date . '周末,跳过');
  47. die();
  48. }
  49. $wishTime = '22:00';
  50. if ($hm !== $wishTime) {
  51. var_dump('不是期望时间不提示'.$wishTime);
  52. die();
  53. }
  54. $riBao = new RiBaoService();
  55. $riBao->sendMsg($data);
  56. }
  57. }