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

金额问题调试

@@ -3,9 +3,47 @@ namespace app\admin\controller; @@ -3,9 +3,47 @@ namespace app\admin\controller;
3 3
4 use app\admin\model\RouteModel; 4 use app\admin\model\RouteModel;
5 use cmf\controller\AdminBaseController; 5 use cmf\controller\AdminBaseController;
  6 +use Dompdf\Image\Cache;
6 use think\Db; 7 use think\Db;
7 class UsersController extends AdminBaseController{ 8 class UsersController extends AdminBaseController{
8 9
  10 + public function get_over(){
  11 + $order = Db::name('indent')->whereIn('state',[2,3,5,6])
  12 + ->whereBetween('pay_time',[1567958400,1568044799])
  13 + ->sum('money');
  14 + echo $order.'--';
  15 + $zhichu = Db::name('money_expend')->where('state',1)
  16 + ->whereBetween('create_time',[1567958400,1568044799])
  17 + ->sum('money');
  18 + echo $zhichu;
  19 + $zhichu1 = Db::name('money_expend')->where('state',1)
  20 + ->whereBetween('create_time',[1567958400,1568044799])
  21 + ->column('id');
  22 + var_dump($zhichu1);
  23 +// $list = Db::name('money_income')->alias('mi')
  24 +// ->field('mi.*,i.uid as iuid,i.money as imoney,indent_type,salesman_uid')
  25 +// ->join('__INDENT__ i','mi.indent_id = i.id')
  26 +// ->where('i.state',2)
  27 +// ->select(false);
  28 +// var_dump($list);
  29 + }
  30 +
  31 + public function over_count() {
  32 + $income = Db::name('money_income')->select();
  33 + $income = collection($income)->toArray();
  34 + $ids = [];
  35 + $money = 0;
  36 + foreach ($income as $k=>$v) {
  37 + $indent = Db::name('indent')->where('id',$v['indent_id'])->find();
  38 + if(!$indent) {
  39 + $ids[] = $v['id'];
  40 + $money += $v['money'];
  41 + }
  42 + }
  43 + var_dump($ids);
  44 + echo $money;
  45 + }
  46 +
9 /** 47 /**
10 * 显示用户列表 48 * 显示用户列表
11 */ 49 */
@@ -65,6 +103,8 @@ class UsersController extends AdminBaseController{ @@ -65,6 +103,8 @@ class UsersController extends AdminBaseController{
65 } 103 }
66 $list[$k]['invite_count'] = $invite_count; 104 $list[$k]['invite_count'] = $invite_count;
67 } 105 }
  106 +// echo Db::name('my_user')->sum('balance');
  107 +// echo Db::name('indent')->where('indent_type',1)->where('state',5)->sum('money');
68 $this->assign('list',$list); 108 $this->assign('list',$list);
69 $this->assign('data',$data); 109 $this->assign('data',$data);
70 $this->assign('keyword',!empty($param['keyword']) ? trim($param['keyword']) : ''); 110 $this->assign('keyword',!empty($param['keyword']) ? trim($param['keyword']) : '');