first commit
This commit is contained in:
58
application/mobile/controller/Sms.php
Normal file
58
application/mobile/controller/Sms.php
Normal file
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
// +------------------------------------------------+
|
||||
// |http://www.cjango.com |
|
||||
// +------------------------------------------------+
|
||||
// | 修复BUG不是一朝一夕的事情,等我喝醉了再说吧! |
|
||||
// +------------------------------------------------+
|
||||
// | Author: 小陈叔叔 <Jason.Chen> |
|
||||
// +------------------------------------------------+
|
||||
namespace app\mobile\controller;
|
||||
|
||||
use app\common\model\Member as MemberModel;
|
||||
use app\common\service\Sms as SmsService;
|
||||
|
||||
class Sms extends _Init
|
||||
{
|
||||
public function _initialize()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* [短信验证码]
|
||||
* @return [type] [description]
|
||||
*/
|
||||
public function getsms()
|
||||
{
|
||||
$mobile = $this->request->post('mobile');
|
||||
$forget = $this->request->post('forget');
|
||||
$MemberInfo = MemberModel::where('username', $mobile)->find();
|
||||
|
||||
if (!empty($MemberInfo) && empty($forget)) {
|
||||
return $this->error('这个手机号已经注册过了');
|
||||
}
|
||||
$res = SmsService::send($mobile);
|
||||
|
||||
if ($res === true) {
|
||||
return $this->success('发送成功');
|
||||
} else {
|
||||
return $this->error($res);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* [短信验证码]
|
||||
* @return [type] [description]
|
||||
*/
|
||||
public function getresms()
|
||||
{
|
||||
$mobile = $this->request->post('mobile');
|
||||
$MemberInfo = MemberModel::where('username', $mobile)->find();
|
||||
$res = SmsService::send($mobile);
|
||||
|
||||
if ($res === true) {
|
||||
return $this->success('发送成功');
|
||||
} else {
|
||||
return $this->error($res);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user