作者 刘朕
1 个管道 的构建 通过 耗费 42 秒

金额问题调试

... ... @@ -3,9 +3,47 @@ namespace app\admin\controller;
use app\admin\model\RouteModel;
use cmf\controller\AdminBaseController;
use Dompdf\Image\Cache;
use think\Db;
class UsersController extends AdminBaseController{
public function get_over(){
$order = Db::name('indent')->whereIn('state',[2,3,5,6])
->whereBetween('pay_time',[1567958400,1568044799])
->sum('money');
echo $order.'--';
$zhichu = Db::name('money_expend')->where('state',1)
->whereBetween('create_time',[1567958400,1568044799])
->sum('money');
echo $zhichu;
$zhichu1 = Db::name('money_expend')->where('state',1)
->whereBetween('create_time',[1567958400,1568044799])
->column('id');
var_dump($zhichu1);
// $list = Db::name('money_income')->alias('mi')
// ->field('mi.*,i.uid as iuid,i.money as imoney,indent_type,salesman_uid')
// ->join('__INDENT__ i','mi.indent_id = i.id')
// ->where('i.state',2)
// ->select(false);
// var_dump($list);
}
public function over_count() {
$income = Db::name('money_income')->select();
$income = collection($income)->toArray();
$ids = [];
$money = 0;
foreach ($income as $k=>$v) {
$indent = Db::name('indent')->where('id',$v['indent_id'])->find();
if(!$indent) {
$ids[] = $v['id'];
$money += $v['money'];
}
}
var_dump($ids);
echo $money;
}
/**
* 显示用户列表
*/
... ... @@ -65,6 +103,8 @@ class UsersController extends AdminBaseController{
}
$list[$k]['invite_count'] = $invite_count;
}
// echo Db::name('my_user')->sum('balance');
// echo Db::name('indent')->where('indent_type',1)->where('state',5)->sum('money');
$this->assign('list',$list);
$this->assign('data',$data);
$this->assign('keyword',!empty($param['keyword']) ? trim($param['keyword']) : '');
... ...