39 lines
1.1 KiB
PHP
39 lines
1.1 KiB
PHP
<?php
|
|
defined('BASEPATH') OR exit('No direct script access allowed');
|
|
|
|
class Biz_settle_model extends HD_Model
|
|
{
|
|
private $table_name = 'lc_biz_settle';
|
|
|
|
public function __construct()
|
|
{
|
|
parent::__construct($this->table_name, 'default');
|
|
}
|
|
|
|
public function selectOrders($where = array(), $order = '', $page = 0, $page_size = 20, $count = 0,$fileds="lc_biz_settle.*")
|
|
{
|
|
$this->db->distinct()->select($fileds);
|
|
$this->db->from('lc_biz_settle');
|
|
$this->db->join('lc_receiver_orders_v2', 'lc_receiver_orders_v2.id = lc_biz_settle.o_id','left');
|
|
if ($where) {
|
|
$this->db->where($where);
|
|
}
|
|
if ($count) {
|
|
$res = $this->db->count_all_results();
|
|
return $res ? $res : 0;
|
|
}
|
|
if ($order) {
|
|
$this->db->order_by($order);
|
|
}
|
|
if ($page) {
|
|
$offset = ($page - 1) * $page_size;
|
|
$limit = $page_size;
|
|
} else {
|
|
$offset = null;
|
|
$limit = null;
|
|
}
|
|
$this->db->limit($limit, $offset);
|
|
return $this->db->get()->result_array();
|
|
}
|
|
}
|