Commit e6078562 authored by twj's avatar twj

twj

parent 7a8d3024
......@@ -55,8 +55,10 @@ class Chargegroup extends Backend
}
[$where, $sort, $order, $offset, $limit] = $this->buildparams();
$list = $this->model
->alias('cg')
->field('*,(select count(1) from ycz_charge_device as cd where user_id=0 and authorizestatus=1 and cd.group_id=cg.id) as remain_units')
->where($where)
->order($sort, $order)
->order('remain_units desc')
->paginate($limit);
foreach ($list as $key => $val){
$list[$key]['remain_units'] = $this->Chargedevicemodel->where(['group_id' =>$val['id'],'authorizestatus' =>1])->count();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment