1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- <?php
- namespace app\controller\admin\system\serve;
- use app\validate\admin\CrmebServeValidata;
- use ln\basic\BaseController;
- use ln\services\CrmebServeServices;
- use think\App;
- class Sms extends BaseController
- {
- protected $services;
-
- public function __construct(App $app, CrmebServeServices $services)
- {
- parent::__construct($app);
- $this->services = $services;
- }
-
- public function changeSign(CrmebServeValidata $validata)
- {
- $data = $this->request->params(['phone','sign','verify_code']);
- $validata->scene('phone')->check(['phone' => $data['phone']]);
- if (!$data['sign']) {
- return app('json')->fail('请设置短信签名');
- }
- $this->services->sms()->modify($data['sign'], $data['phone'], $data['verify_code']);
- return app('json')->success('修改短信签名成功');
- }
-
- public function temps()
- {
- [$page, $limit] = $this->getPage();
- $type = $this->request->param('type');
- return app('json')->success($this->services->getSmsTempsList((int)$page, (int)$limit, (int)$type));
- }
-
- public function apply()
- {
- $data = $this->request->params(['title','type','content']);
- if (!$data['title'] || !$data['content'] || !$data['type']) {
- return app('json')->success('请填写申请模板内容');
- }
- $ret = $this->services->sms()->apply($data['title'], $data['content'], (int)$data['type']);
- return app('json')->success($ret);
- }
-
- public function applyRecord()
- {
- [$page, $limit] = $this->getPage();
- $tempType = $this->request->param('temp_type');
- if (!$tempType) return app('json')->fail('缺少类型');
- $ret = $this->services->sms()->applys($tempType, $page, $limit);
- return app('json')->success($ret);
- }
- }
|