Qc.php 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <?php
  2. namespace app\api\controller;
  3. use app\common\model\ArticleItem;
  4. use app\common\model\DatumIntro;
  5. use app\common\model\DatumUrl;
  6. use app\common\model\LabelMessage;
  7. use app\common\model\LevelOrder as LOM;
  8. use app\common\model\TopSearch;
  9. use app\common\model\User;
  10. use app\common\model\UserSearch;
  11. use app\common\model\VideoUrl;
  12. use app\common\service\CheckPower;
  13. use app\common\service\Elasticsearch;
  14. use app\common\service\OrderCallback;
  15. use app\common\service\UserSynth;
  16. use Firebase\JWT\JWT;
  17. use library\tools\Data;
  18. use think\cache\driver\Redis;
  19. use think\Db;
  20. use think\facade\Hook;
  21. use function AlibabaCloud\Client\value;
  22. class Qc extends Base {
  23. // 热搜设置
  24. public function topSearchSet()
  25. {
  26. // 视频
  27. $list = VideoUrl::column('id');
  28. array_walk($list,function ($v){
  29. // VideoUrl::where('id',$v)->update(['hot_time'=>date('Y-m-d H:i:s')]);
  30. TopSearch::saveData($v,'video');
  31. });
  32. // 图文
  33. $list = ArticleItem::column('id');
  34. array_walk($list,function ($v){
  35. // ArticleItem::where('id',$v)->update(['hot_time'=>date('Y-m-d H:i:s')]);
  36. TopSearch::saveData($v,'article');
  37. });
  38. // 资料
  39. $list = DatumUrl::column('id');
  40. array_walk($list,function ($v){
  41. // DatumUrl::where('id',$v)->update(['hot_time'=>date('Y-m-d H:i:s')]);
  42. TopSearch::saveData($v,'datum');
  43. });
  44. // 活动
  45. $list = \app\common\model\Activity::column('id');
  46. array_walk($list,function ($v){
  47. //\app\common\model\Activity::where('id',$v)->update(['hot_time'=>date('Y-m-d H:i:s')]);
  48. TopSearch::saveData($v,'activity');
  49. });
  50. // 需求
  51. $list = \app\common\model\PlatformDemand::column('id');
  52. array_walk($list,function ($v){
  53. // \app\common\model\PlatformDemand::where('id',$v)->update(['hot_time'=>date('Y-m-d H:i:s')]);
  54. TopSearch::saveData($v,'demand');
  55. });
  56. // 新闻
  57. $list = \app\common\model\Press::column('id');
  58. array_walk($list,function ($v){
  59. // \app\common\model\Press::where('id',$v)->update(['hot_time'=>date('Y-m-d H:i:s')]);
  60. TopSearch::saveData($v,'press');
  61. });
  62. // 问答
  63. $list = \app\common\model\UserForum::column('id');
  64. array_walk($list,function ($v){
  65. // \app\common\model\UserForum::where('id',$v)->update(['hot_time'=>date('Y-m-d H:i:s')]);
  66. TopSearch::saveData($v,'forum');
  67. });
  68. // 招聘
  69. $list = \app\common\model\Recruit::column('id');
  70. array_walk($list,function ($v){
  71. // \app\common\model\Recruit::where('id',$v)->update(['hot_time'=>date('Y-m-d H:i:s')]);
  72. TopSearch::saveData($v,'recruit');
  73. });
  74. // 供应商
  75. $list = \app\common\model\SupplierGoods::column('id');
  76. array_walk($list,function ($v){
  77. // \app\common\model\SupplierGoods::where('id',$v)->update(['hot_time'=>date('Y-m-d H:i:s')]);
  78. TopSearch::saveData($v,'supplier_goods');
  79. });
  80. // 商品
  81. $list = \app\common\model\StoreGoods::column('id');
  82. array_walk($list,function ($v){
  83. // \app\common\model\StoreGoods::where('id',$v)->update(['hot_time'=>date('Y-m-d H:i:s')]);
  84. TopSearch::saveData($v,'goods');
  85. });
  86. }
  87. // 短信发送测试
  88. public function phoneMessage()
  89. {
  90. $res = UserSynth::phoneMessageSend(18669648837,0,['ActivityName'=>'qc','time'=>date("Y-m-d H:i:s"),'adress'=>'山东临沂','url'=>'?a=1']);
  91. $this->success('ok',$res);
  92. }
  93. public function emailSend()
  94. {
  95. $res = UserSynth::emailSend('913856018@qq.com','aaaa');
  96. $this->success('ok',$res);
  97. }
  98. public function ticketSend()
  99. {
  100. $res = UserSynth::ticketSend(input('ticket_id'));
  101. $this->success('ok',$res);
  102. }
  103. public function sendEmail()
  104. {
  105. $this->success(send_email('913856018@qq.com','AAAAAAAAAAAAAAAAA'));
  106. }
  107. public function index_match()
  108. {
  109. $password = "123456879_/";
  110. //密码必须包含大小写字母/数字/符号任意两者组合
  111. $regStr = "/^(?![0-9]+$)(?![a-z]+$)(?![A-Z]+$)(?!([^(0-9a-zA-Z)]|[\(\)])+$)([^(0-9a-zA-Z)]|[\(\)]|[a-z]|[A-Z]|[0-9]){6,16}$/";
  112. var_dump(preg_match($regStr, $password));
  113. }
  114. }