作者 李涵
1 个管道 的构建 通过 耗费 1 秒

合并分支 'li' 到 'master'

赠送积分和角色管理



查看合并请求 !599
... ... @@ -108,23 +108,24 @@ class AdminIndexController extends AdminBaseController
//先查此人的下级
$son_arr = Db::name('user')->where(['parent_id' => $item['id']])->field('id')->select();
if (!empty($son_arr)) {
$son_str = '';
foreach ($son_arr as $k => $v) {
if ($k == count($son_arr) - 1) {
$son_str .= $v['id'];
} else {
$son_str .= $v['id'] . ',';
}
}
$map = [
'uid' => ['in', $son_str],
'pay_type' => ['eq', 3],
'step' => ['neq', 1]
];
$data = Db::name('zj_order')->where($map)->field('sum(whole) as whole,sum(whole_num) as whole_num')->select();
$whole = $data[0]['whole'];
$whole_num = $data[0]['whole_num'];
$total = $whole - $whole_num;
// $son_str = '';
// foreach ($son_arr as $k => $v) {
// if ($k == count($son_arr) - 1) {
// $son_str .= $v['id'];
// } else {
// $son_str .= $v['id'] . ',';
// }
// }
// $map = [
// 'uid' => ['in', $son_str],
// 'pay_type' => ['eq', 3],
// 'step' => ['neq', 1]
// ];
// $data = Db::name('zj_order')->where($map)->field('sum(whole) as whole,sum(whole_num) as whole_num')->select();
// $whole = $data[0]['whole'];
// $whole_num = $data[0]['whole_num'];
// $total = $whole - $whole_num;
$total = '???' ;
} else {
$total = 0;
}
... ...