where('is_delete', 0) ->where('order_id', 'in', $order_ids) ->where('is_pay', '=', $is_pay) ->select()->toArray(); } public function fetchByAdviser($admin_id, $text = null, $start_time = null, $end_time = null, $page = 1, $size = 10) { $where = [ ['is_delete', '=', 0], ['is_pay', '=', 0], ]; if ($text) array_push($where, ['customer_name|customer_mobile', 'like', "%" . $text . "%"]); if ($start_time) array_push($where, ['order_create_time', '>=', $start_time]); if ($end_time) array_push($where, ['order_create_time', '<=', $end_time]); return [ $this->where($where) ->where("FIND_IN_SET('{$admin_id}', adviser_ids)") ->page($page) ->paginate($size), $this->where($where)->sum("fee") ]; } public function fetchByOrderProductId(array $o_p_ids) { $where = [ ['is_delete', '=', 0], ['order_product_id', 'in', $o_p_ids], ]; return $this->where($where) ->select()->toArray(); } }