|
|
|
@ -38,12 +38,23 @@ class OrderTableService extends BaseAdminService |
|
|
|
* @param array $where |
|
|
|
* @return array |
|
|
|
*/ |
|
|
|
public function getPage(array $where = []) |
|
|
|
public function getPage(array $data = []) |
|
|
|
{ |
|
|
|
$where = []; |
|
|
|
$field = 'id,resource_id,payment_id,order_status,payment_type,order_amount,course_id,class_id,staff_id,after_sales_status,after_sales_reason,after_sales_time,created_at,updated_at,payment_time,subscription_payment_time'; |
|
|
|
$order = 'id desc'; |
|
|
|
|
|
|
|
$search_model = $this->model->withSearch(["order_status","payment_type","resource_id"], $where)->with(['customerResources','course','classGrade','personnel'])->field($field)->order($order); |
|
|
|
if($data['order_status']){ |
|
|
|
$where[] = ['order_status','=',$data['order_status']]; |
|
|
|
} |
|
|
|
|
|
|
|
if($data['payment_type']){ |
|
|
|
$where[] = ['payment_type','=',$data['payment_type']]; |
|
|
|
} |
|
|
|
|
|
|
|
if($data['resource_id']){ |
|
|
|
$where[] = ['resource_id','=',$data['resource_id']]; |
|
|
|
} |
|
|
|
$search_model = $this->model->where($where)->with(['customerResources','course','classGrade','personnel'])->field($field)->order($order); |
|
|
|
$list = $this->pageQuery($search_model); |
|
|
|
return $list; |
|
|
|
} |
|
|
|
|