|
|
|
@ -590,11 +590,14 @@ class SpendCountSetController extends \Think\Controller
|
|
|
|
|
{
|
|
|
|
|
$map = array(
|
|
|
|
|
"create_time"=> array('BETWEEN',array($this->beginThismonth, $this->endThismonth)),
|
|
|
|
|
"status"=>1
|
|
|
|
|
);
|
|
|
|
|
$add = M("provide_user","tab_")->field("sum(amount) amount")->where($map)->find()['amount'];
|
|
|
|
|
$add || $add=0;
|
|
|
|
|
|
|
|
|
|
$jq = M("user_coin","tab_")->field("sum(num) num")->where($map)->find()['num'];
|
|
|
|
|
$jq = M("user_coin","tab_")->field("sum(num) num")->where(array(
|
|
|
|
|
"create_time"=> array('BETWEEN',array($this->beginThismonth, $this->endThismonth))
|
|
|
|
|
))->find()['num'];
|
|
|
|
|
$jq || $jq=0;
|
|
|
|
|
return $add-$jq;
|
|
|
|
|
}
|
|
|
|
@ -603,11 +606,14 @@ class SpendCountSetController extends \Think\Controller
|
|
|
|
|
{
|
|
|
|
|
$map = array(
|
|
|
|
|
"create_time"=> array('BETWEEN',array($this->beginThismonth, $this->endThismonth)),
|
|
|
|
|
"status"=>1
|
|
|
|
|
);
|
|
|
|
|
$add = M("provide","tab_")->field("sum(amount) amount")->where($map)->find()['amount'];
|
|
|
|
|
$add || $add=0;
|
|
|
|
|
|
|
|
|
|
$jq = M("deduct_bind_record","tab_")->field("sum(quantity) quantity")->where($map)->find()['quantity'];
|
|
|
|
|
$jq = M("deduct_bind_record","tab_")->field("sum(quantity) quantity")->where(array(
|
|
|
|
|
"create_time"=> array('BETWEEN',array($this->beginThismonth, $this->endThismonth))
|
|
|
|
|
))->find()['quantity'];
|
|
|
|
|
$jq || $jq=0;
|
|
|
|
|
return $add-$jq;
|
|
|
|
|
}
|
|
|
|
|