|
|
|
@ -2,6 +2,7 @@
|
|
|
|
|
|
|
|
|
|
namespace Admin\Controller;
|
|
|
|
|
use User\Api\UserApi as UserApi;
|
|
|
|
|
use Base\Service\PromoteService as PromoteService;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 后台首页控制器
|
|
|
|
@ -57,6 +58,8 @@ class MendController extends ThinkController {
|
|
|
|
|
|
|
|
|
|
public function edit($id = null)
|
|
|
|
|
{
|
|
|
|
|
// $promoteService = new PromoteService();
|
|
|
|
|
|
|
|
|
|
if (IS_POST) {
|
|
|
|
|
if ($_POST['prmoote_id_to'] == -1){
|
|
|
|
|
$_POST['prmoote_id_to'] = 0;
|
|
|
|
@ -68,12 +71,14 @@ class MendController extends ThinkController {
|
|
|
|
|
$this->error('没有变更数据');
|
|
|
|
|
}
|
|
|
|
|
$create = $_REQUEST;
|
|
|
|
|
dump($create);
|
|
|
|
|
$map['id'] = $create['user_id'];
|
|
|
|
|
$map_['user_id'] = $create['user_id'];
|
|
|
|
|
$data['promote_id'] = $create['prmoote_id_to'];
|
|
|
|
|
$data['promote_account'] = get_promote_name($create['prmoote_id_to']);
|
|
|
|
|
// 加入补链时间
|
|
|
|
|
$data['rebind_time'] = $create['rebind_time'];
|
|
|
|
|
dump($data);
|
|
|
|
|
$user_data = $data;
|
|
|
|
|
$promote = M('promote', 'tab_')->where(array("id"=>I('prmoote_id_to')))->find();
|
|
|
|
|
if ($promote['parent_id'] != "0") {
|
|
|
|
@ -85,24 +90,24 @@ class MendController extends ThinkController {
|
|
|
|
|
|
|
|
|
|
$user_data['parent_name']=get_promote_name($user_data['parent_id']);
|
|
|
|
|
|
|
|
|
|
$user = M('user', 'tab_')->where($map)->save($user_data);
|
|
|
|
|
$user_ = M('UserPlay', 'tab_')->where($map_)->save($data);
|
|
|
|
|
$puser_ = M('UserPlayInfo', 'tab_')->where($map_)->save($data);
|
|
|
|
|
$spend = M('Spend', 'tab_')->where($map_)->where(array('is_check'=>array('in','1,2')))->save($data);// spend只改未对账的数据
|
|
|
|
|
$depost = M('Deposit', 'tab_')->where($map_)->save($data);
|
|
|
|
|
$Bind_spend = M('Bind_spend', 'tab_')->where($map_)->save($data);
|
|
|
|
|
$create['user_account'] = get_user_account($create['user_id']);
|
|
|
|
|
$create['promote_account'] = get_promote_name($create['promote_id']);
|
|
|
|
|
$create['promote_id_to'] = $create['prmoote_id_to'];
|
|
|
|
|
$create['promote_account_to'] = get_promote_name($create['prmoote_id_to']);
|
|
|
|
|
$create['create_time'] = time();
|
|
|
|
|
$create['op_id'] = UID;
|
|
|
|
|
$create['op_account'] = session('user_auth.username');
|
|
|
|
|
$create['bind_type'] = $create['bind_type'];
|
|
|
|
|
$mend = M('mend', 'tab_')->add($create);
|
|
|
|
|
if ($mend) {
|
|
|
|
|
$this->success('补链成功', U('lists'), 2);
|
|
|
|
|
}
|
|
|
|
|
// $user = M('user', 'tab_')->where($map)->save($user_data);
|
|
|
|
|
// $user_ = M('UserPlay', 'tab_')->where($map_)->save($data);
|
|
|
|
|
// $puser_ = M('UserPlayInfo', 'tab_')->where($map_)->save($data);
|
|
|
|
|
// $spend = M('Spend', 'tab_')->where($map_)->where(array('is_check'=>array('in','1,2')))->save($data);// spend只改未对账的数据
|
|
|
|
|
// $depost = M('Deposit', 'tab_')->where($map_)->save($data);
|
|
|
|
|
// $Bind_spend = M('Bind_spend', 'tab_')->where($map_)->save($data);
|
|
|
|
|
// $create['user_account'] = get_user_account($create['user_id']);
|
|
|
|
|
// $create['promote_account'] = get_promote_name($create['promote_id']);
|
|
|
|
|
// $create['promote_id_to'] = $create['prmoote_id_to'];
|
|
|
|
|
// $create['promote_account_to'] = get_promote_name($create['prmoote_id_to']);
|
|
|
|
|
// $create['create_time'] = time();
|
|
|
|
|
// $create['op_id'] = UID;
|
|
|
|
|
// $create['op_account'] = session('user_auth.username');
|
|
|
|
|
// $create['bind_type'] = $create['bind_type'];
|
|
|
|
|
// $mend = M('mend', 'tab_')->add($create);
|
|
|
|
|
// if ($mend) {
|
|
|
|
|
// $this->success('补链成功', U('lists'), 2);
|
|
|
|
|
// }
|
|
|
|
|
} else {
|
|
|
|
|
$user = A('User', 'Event');
|
|
|
|
|
$user_data = $user->user_entity($id);
|
|
|
|
|