SmsRecord.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. namespace app\admin\controller\sms;
  3. use app\admin\controller\AuthController;
  4. use crmeb\services\JsonService;
  5. use app\admin\model\sms\SmsRecord as SmsRecordModel;
  6. use crmeb\services\sms\Sms;
  7. use crmeb\services\UtilService;
  8. /**
  9. * 短息发送日志
  10. * Class SmsLog
  11. * @package app\admin\controller\sms
  12. */
  13. class SmsRecord extends AuthController
  14. {
  15. /**
  16. * @var Sms
  17. */
  18. protected $smsHandle;
  19. protected function initialize()
  20. {
  21. parent::initialize(); // TODO: Change the autogenerated stub
  22. $this->smsHandle = new Sms('yunxin', [
  23. 'sms_account' => sys_config('sms_account'),
  24. 'sms_token' => sys_config('sms_token'),
  25. 'site_url' => sys_config('site_url')
  26. ]);
  27. }
  28. /**
  29. * 短信记录页面
  30. * @return string
  31. */
  32. public function index()
  33. {
  34. if (!$this->smsHandle->isLogin()) return redirect(url('sms.smsConfig/index').'?type=4&tab_id=18');
  35. return $this->fetch();
  36. }
  37. /**
  38. * 获取短信记录列表
  39. */
  40. public function recordList()
  41. {
  42. $where = UtilService::getMore([
  43. ['page', 1],
  44. ['limit', 20],
  45. ['type', ''],
  46. ['uid', ''],
  47. ['phone', ''],
  48. ]);
  49. return JsonService::successlayui(SmsRecordModel::getRecordList($where));
  50. }
  51. }