1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- <?php
- // +----------------------------------------------------------------------
- // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
- // +----------------------------------------------------------------------
- // | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
- // +----------------------------------------------------------------------
- // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
- // +----------------------------------------------------------------------
- // | Author: CRMEB Team <admin@crmeb.com>
- // +----------------------------------------------------------------------
- namespace app\services\system;
- use app\model\system\SmsRecord;
- use app\services\user\UserServices;
- use qiniu\services\CacheService;
- use qiniu\basic\BaseServices;
- use think\exception\ValidateException;
- use think\facade\Config;
- /**
- * 短信发送记录
- * Class SmsRecordServices
- * @package app\services\message\sms
- * @mixin SmsRecord
- */
- class SmsRecordServices extends BaseServices
- {
- /**
- * 构造方法
- * SmsRecordServices constructor.
- * @param SmsRecord $model
- */
- public function __construct(SmsRecord $model)
- {
- $this->model = $model;
- }
- /**
- * 获取短信发送列表
- * @param array $where
- * @return array
- * @throws \think\db\exception\DataNotFoundException
- * @throws \think\db\exception\DbException
- * @throws \think\db\exception\ModelNotFoundException
- */
- public function getRecordList(array $where)
- {
- [$page, $limit] = $this->getPageValue();
- $data = $this->getList($where, $page, $limit);
- $count = $this->getCount($where);
- return compact('data', 'count');
- }
- public function setRecord($phone, $template, $content, $ip, $store = 'qiniu', $record_id = 0, $uid = 0)
- {
- return $this->create([
- 'phone' => $phone,
- 'template' => $template,
- 'content' => $content,
- 'add_ip' => $ip,
- 'store' => $store,
- 'uid' => $uid,
- 'record_id' => $record_id,
- ]);
- }
- }
|