@ -265,7 +279,7 @@ class SpendCountSetController extends \Think\Controller
}
// return true;
}
public function setRoot()
public function getRoot()
{
if(!$this->continue){
die("api error");
@ -312,6 +326,7 @@ class SpendCountSetController extends \Think\Controller
//获取会长信息
public function getRootUser()
{
if(!$this->continue) die("api error");
//获取所有数据
$month = $this->date;
$from = "
@ -342,13 +357,18 @@ class SpendCountSetController extends \Think\Controller
"count_date"=>$this->date,
"create_time"=>$this->nowdata
);
M("spend_user_count","tab_")->add($adddata);
$tempdbres = $this->usermodel->add($adddata);
if(!$tempdbres){
$this->usermodel->rollback();
die("getRootUser error");
}
}
}
//获取组长信息
public function getParentUser()
{
if(!$this->continue) die("api error");
$month =$this->date;
//获取数据
$from = "
@ -377,13 +397,18 @@ class SpendCountSetController extends \Think\Controller
"count_date"=>$this->date,
"create_time"=>$this->nowdata
);
M("spend_user_count","tab_")->add($adddata);
$tempdbres = $this->usermodel->add($adddata);
if(!$tempdbres){
$this->usermodel->rollback();
die("getParentUser error");
}
}
}
//获取组员
public function getPromoteUser()
{
if(!$this->continue) die("api error");
$month = $this->date;;
//获取数据
$from = "
@ -410,14 +435,18 @@ class SpendCountSetController extends \Think\Controller
"count_date"=>$this->date,
"create_time"=>$this->nowdata
);
M("spend_user_count","tab_")->add($adddata);
$tempdbres = $this->usermodel->add($adddata);
if(!$tempdbres){
$this->usermodel->rollback();
die("getPromoteUser error");
}
}
# code...
}
//处理inside_cash_count
public function getInsideData2()
{
if(!$this->continue) die("api error");
$insideRes = M()
->table("tab_deposit deposit")
->field("promote_id,promote_account,IFNULL(promote.parent_id,0) parent_id,parent_name,sum(pay_amount) inside_cash_count,'{$this->date}' as count_date,'{$this->nowdata}' as create_time")
@ -469,7 +498,11 @@ class SpendCountSetController extends \Think\Controller