公会分成管理--更新

master
chenxiaojun 5 years ago
commit 29789f5ef6

@ -4,6 +4,7 @@ namespace Admin\Controller;
use User\Api\UserApi; use User\Api\UserApi;
use Com\Wechat; use Com\Wechat;
use Com\WechatAuth; use Com\WechatAuth;
use Base\Tool\TaskClient;
/** /**
* 后台首页控制器 * 后台首页控制器
@ -78,7 +79,9 @@ class PublicController extends \Think\Controller
if (IS_POST) { if (IS_POST) {
/* 检测验证码 TODO: */ /* 检测验证码 TODO: */
$this->checksafecode($mobile, $verify, false); if (!$this->checksafecode($mobile, $verify)) {
$this->error('验证码错误');
}
$promote = M('promote', 'tab_')->where([ $promote = M('promote', 'tab_')->where([
'mobile_phone' => $mobile, 'mobile_phone' => $mobile,
'level' => 1, 'level' => 1,
@ -341,41 +344,31 @@ class PublicController extends \Think\Controller
*/ */
public function telsafecode($phone = '', $delay = 10, $flag = true) public function telsafecode($phone = '', $delay = 10, $flag = true)
{ {
$result = R('Common/Sms/send_sms_code', array($phone, $delay, false)); $taskClient = new TaskClient();
$result = $taskClient->sendSms($phone);
if ($result['code'] == 200) { $data = [];
if ($result['code'] == TaskClient::SUCCESS) {
$data['status'] = 1; $data['status'] = 1;
$data['data'] = $result['data'];
} else { } else {
$data['status'] = 0; $data['status'] = 0;
} }
$data['msg'] = $result['message'];
$data['msg'] = $result['msg'];
echo json_encode($data); echo json_encode($data);
exit; exit;
} }
/** /**
* 手机安全码验证 * 手机安全码验证
* @param bool $flag true 用于直接异步请求 false 用于方法调用
* @param [type] $vcode [description]
*/ */
public function checksafecode($phone, $vcode, $flag = true) public function checksafecode($phone, $code)
{ {
$result = R('Common/Sms/verify_sms_code', array($phone, $vcode, false)); $taskClient = new TaskClient();
$result = $taskClient->checkSms($phone, $code);
if ($result['code'] == 200) { $data = [];
$data['status'] = 1; if ($result && $result['code'] == TaskClient::SUCCESS) {
if ($flag) { return true;
echo json_encode($data);
exit;
}
} else { } else {
$data['status'] = 0; return false;
$data['msg'] = $result['msg'];
echo json_encode($data);
exit;
} }
} }

@ -232,20 +232,20 @@ class PromoteController extends BaseController
$this->assign("rules", $rules); $this->assign("rules", $rules);
$this->assign("rules_count", count($rules)); $this->assign("rules_count", count($rules));
// $redis = new \Org\RedisSDK\Redis(['host'=>'127.0.0.1','port'=>6379],[]); $redis = new \Org\RedisSDK\Redis(['host'=>'127.0.0.1','port'=>6379],[]);
// $cacheKey = "pop:rule:set"; $cacheKey = "pop:rule:set";
// if (!$redis->sIsMember($cacheKey, get_pid())) { if (!$redis->sIsMember($cacheKey, get_pid())) {
// $currentTime = strtotime(date('Y-m-d')); $currentTime = strtotime(date('Y-m-d'));
// $weekArray = [7,1,2,3,4,5,6]; $weekArray = [7,1,2,3,4,5,6];
// $week = $weekArray[date("w")]; $week = $weekArray[date("w")];
// $match_rules = M("document_pop_rules") $match_rules = M("document_pop_rules")
// ->field('id') ->field('id')
// ->where("(type = 1 and pop_time = {$currentTime}) or (type = 2 and pop_time = {$week})") ->where("(type = 1 and pop_time = {$currentTime}) or (type = 2 and pop_time = {$week})")
// ->order("sort asc, id desc") ->order("sort asc, id desc")
// ->select(); ->select();
// } else { } else {
// $match_rules = []; $match_rules = [];
// } }
$this->assign("match_rules_id", $match_rules ? json_encode(array_column($match_rules, 'id')) : 'null'); $this->assign("match_rules_id", $match_rules ? json_encode(array_column($match_rules, 'id')) : 'null');

@ -237,7 +237,7 @@
<script type="text/javascript"> <script type="text/javascript">
$().ready(function () { $().ready(function () {
setValue('row', '{:I("get.row",10)}'); setValue('row', '{:I("get.row",10)}');
setValue('settlement_type', '{:I("get.settlement_type",0)}'); setValue('settlement_type', '{:I("get.settlement_type","")}');
var date = "{$setdate}"; var date = "{$setdate}";
$('#sdate').datetimepicker({ $('#sdate').datetimepicker({
format: 'yyyy-mm-dd', format: 'yyyy-mm-dd',

Loading…
Cancel
Save