$datas = M('user', 'tab_')->alias('u')->field("u.id, u.account, {$valueQuery8} as totalvalue, {$valueQuery5} as spendvalue, {$valueQuery6} as deposit, {$valueQuery7} as promoteCoin , if (({$valueQuery6}) - ({$valueQuery5}) > 0, ({$valueQuery6}) - ({$valueQuery5}), 0) as restvalue")->where($map0)->page($page,$row)->order($order)->group('u.id')->select();
$datas = M('user', 'tab_')->alias('u')->field("u.id, u.account, {$valueQuery8} as totalvalue, {$valueQuery5} as spendvalue, {$valueQuery6} as deposit, {$valueQuery7} as promoteCoin , if (({$valueQuery8}) - ({$valueQuery9}) > 0, ({$valueQuery8}) - ({$valueQuery9}), 0) as restvalue")->where($map0)->page($page,$row)->order($order)->group('u.id')->select();
$query = M('user', 'tab_')->alias('u')->field("u.id, u.account, {$valueQuery8} as totalvalue, {$valueQuery5} as spendvalue, {$valueQuery6} as deposit, {$valueQuery7} as promoteCoin , if (({$valueQuery6}) - ({$valueQuery5}) > 0, ({$valueQuery6}) - ({$valueQuery5}), 0) as restvalue")->where($map0)->order($order)->group('u.id')->buildSql();
$query = M('user', 'tab_')->alias('u')->field("u.id, u.account, {$valueQuery8} as totalvalue, {$valueQuery5} as spendvalue, {$valueQuery6} as deposit, {$valueQuery7} as promoteCoin , if (({$valueQuery8}) - ({$valueQuery9}) > 0, ({$valueQuery8}) - ({$valueQuery9}), 0) as restvalue")->where($map0)->order($order)->group('u.id')->buildSql();