|
|
@ -22,6 +22,12 @@ class MendController extends BaseController
|
|
|
|
$row = intval(I('row', 10));
|
|
|
|
$row = intval(I('row', 10));
|
|
|
|
$params = I('get.');
|
|
|
|
$params = I('get.');
|
|
|
|
$loginer = $this->getLoginPromote();
|
|
|
|
$loginer = $this->getLoginPromote();
|
|
|
|
|
|
|
|
$promoteService = new PromoteService();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$permPromote = $loginer;
|
|
|
|
|
|
|
|
if ($loginer['shift_over_apply'] == 1) {
|
|
|
|
|
|
|
|
$permPromote = $promoteService->getTopPromote($loginer);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$map = ['op_type' => 1, '_string' => '1=1'];
|
|
|
|
$map = ['op_type' => 1, '_string' => '1=1'];
|
|
|
|
if(isset($params['account'])) {
|
|
|
|
if(isset($params['account'])) {
|
|
|
@ -43,8 +49,7 @@ class MendController extends BaseController
|
|
|
|
$map['order_time'] = ['elt', strtotime($params['time_end']) + 86399];
|
|
|
|
$map['order_time'] = ['elt', strtotime($params['time_end']) + 86399];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$promoteService = new PromoteService();
|
|
|
|
$subInSql = $promoteService->subInSql($permPromote);
|
|
|
|
$subInSql = $promoteService->subInSql($loginer);
|
|
|
|
|
|
|
|
$map['_string'] .= ' and (promote_id in (' . $subInSql . ') or promote_id_to in (' . $subInSql . '))';
|
|
|
|
$map['_string'] .= ' and (promote_id in (' . $subInSql . ') or promote_id_to in (' . $subInSql . '))';
|
|
|
|
|
|
|
|
|
|
|
|
$records = M('mend', 'tab_')->where($map)->order('create_time desc')->page($page, $row)->select();
|
|
|
|
$records = M('mend', 'tab_')->where($map)->order('create_time desc')->page($page, $row)->select();
|
|
|
@ -62,8 +67,8 @@ class MendController extends BaseController
|
|
|
|
$this->assign('_page', $page);
|
|
|
|
$this->assign('_page', $page);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$levelColumn = 'level'. $loginer['level'] . '_id';
|
|
|
|
$levelColumn = 'level'. $permPromote['level'] . '_id';
|
|
|
|
$promotes = M('promote', 'tab_')->field(['id', 'account'])->where([$levelColumn => $loginer['id']])->select();
|
|
|
|
$promotes = M('promote', 'tab_')->field(['id', 'account'])->where([$levelColumn => $permPromote['id']])->select();
|
|
|
|
|
|
|
|
|
|
|
|
$this->assign('promotes', $promotes);
|
|
|
|
$this->assign('promotes', $promotes);
|
|
|
|
$this->assign('count', $count);
|
|
|
|
$this->assign('count', $count);
|
|
|
@ -81,13 +86,19 @@ class MendController extends BaseController
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$loginer = $this->getLoginPromote();
|
|
|
|
$loginer = $this->getLoginPromote();
|
|
|
|
$levelColumn = 'level'. $loginer['level'] . '_id';
|
|
|
|
$permPromote = $loginer;
|
|
|
|
$promote = M('promote', 'tab_')->where(['id' => $user['promote_id']])->where([$levelColumn => $loginer['id']])->find();
|
|
|
|
$promoteService = new PromoteService();
|
|
|
|
|
|
|
|
if ($loginer['shift_over_apply'] == 1) {
|
|
|
|
|
|
|
|
$permPromote = $promoteService->getTopPromote($loginer);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$levelColumn = 'level'. $permPromote['level'] . '_id';
|
|
|
|
|
|
|
|
$promote = M('promote', 'tab_')->where(['id' => $user['promote_id']])->where([$levelColumn => $permPromote['id']])->find();
|
|
|
|
if (!$promote) {
|
|
|
|
if (!$promote) {
|
|
|
|
return $this->error('所属推广员异常');
|
|
|
|
return $this->error('所属推广员异常');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$promotes = M('promote', 'tab_')->field(['id', 'account'])->where([$levelColumn => $loginer['id']])->select();
|
|
|
|
$promotes = M('promote', 'tab_')->field(['id', 'account'])->where([$levelColumn => $permPromote['id']])->select();
|
|
|
|
|
|
|
|
|
|
|
|
$this->meta_title = '玩家补链';
|
|
|
|
$this->meta_title = '玩家补链';
|
|
|
|
$this->assign('user', $user);
|
|
|
|
$this->assign('user', $user);
|
|
|
@ -99,9 +110,16 @@ class MendController extends BaseController
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$params = I('post.');
|
|
|
|
$params = I('post.');
|
|
|
|
$loginer = $this->getLoginPromote();
|
|
|
|
$loginer = $this->getLoginPromote();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$permPromote = $loginer;
|
|
|
|
|
|
|
|
$promoteService = new PromoteService();
|
|
|
|
|
|
|
|
if ($loginer['shift_over_apply'] == 1) {
|
|
|
|
|
|
|
|
$permPromote = $promoteService->getTopPromote($loginer);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$service = new MendService();
|
|
|
|
$service = new MendService();
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
$service->addMendTask($params, $loginer);
|
|
|
|
$service->addMendTask($params, $permPromote, $loginer);
|
|
|
|
$this->ajaxReturn(['status' => 1, 'msg' => '补链申请成功']);
|
|
|
|
$this->ajaxReturn(['status' => 1, 'msg' => '补链申请成功']);
|
|
|
|
} catch (\Exception $e) {
|
|
|
|
} catch (\Exception $e) {
|
|
|
|
$this->ajaxReturn(['status' => 0, 'msg' => $e->getMessage()]);
|
|
|
|
$this->ajaxReturn(['status' => 0, 'msg' => $e->getMessage()]);
|
|
|
|