|
|
@@ -90,22 +90,29 @@ class ReceiptOrderDao |
|
|
|
try { |
|
|
|
$where = []; |
|
|
|
if (!empty($param['name'])) { |
|
|
|
$where['name'] = $param['name']; |
|
|
|
$where['a.name'] = ["like","%".$param['name']."%"]; |
|
|
|
} |
|
|
|
if ($param['status'] != 'all') { |
|
|
|
$where["status"] = $param['status']; |
|
|
|
$where["a.status"] = $param['status']; |
|
|
|
} |
|
|
|
$offset = ($param['pageNum'] - 1) * $param['pageSize']; |
|
|
|
$receiptOrder = new ReceiptOrder(); |
|
|
|
$total = $receiptOrder |
|
|
|
->alias("a") |
|
|
|
->join('hbp_order_main b', 'a.id = b.receipt_order_id', 'left') |
|
|
|
->field("a.*,count(1) cnt,sum(b.total_amount) total_amount") |
|
|
|
->group("a.id") |
|
|
|
->where($where)->count(); |
|
|
|
|
|
|
|
$list = $receiptOrder |
|
|
|
->alias("a") |
|
|
|
->join('hbp_order_main b', 'a.id = b.receipt_order_id', 'left') |
|
|
|
->field("a.*,count(1),sum(b.total_amount)") |
|
|
|
->field("a.*,count(1) cnt,sum(b.total_amount) total_amount") |
|
|
|
->group("a.id") |
|
|
|
->where($where); |
|
|
|
$total = $list->count(); |
|
|
|
$list = $list->limit($offset, $param['pageSize'])->select(); |
|
|
|
$data = ["total" => $total, "list" => $list]; |
|
|
|
->where($where) |
|
|
|
->limit($offset, $param['pageSize']) |
|
|
|
->order("id","DESC")->select(); |
|
|
|
$data = ["total" => $total, "list" => $list->toArray()]; |
|
|
|
return Util::returnArrSu("", $data); |
|
|
|
} catch (Exception $e) { |
|
|
|
return Util::returnArrSu("", ["total" => 0, "list" => []]); |
|
|
|