'合同签订',1 => '办理分期',2 => '车辆确认',3 => '申请开票',4=>'代理服务',5 => '交付确认', 6 => '完成交付', 7 => '申请退款']; public function __construct() { parent::__construct($this->table_name, 'default'); } public function get_step($mobile){ $t1 = 'lc_receiver_orders'; //$t2 = 'lc_receiver_order_contracts'; $this->db->select("$t1.*"); $this->db->from($t1); //$this->db->join($t2, "$t2.o_id = $t1.id and $t2.type=3",'left'); //$where = [ // "$t1.mobile" => $mobile, // "($t2.status<1 or $t2.status is null)" => null //]; $where = [ "$t1.mobile" => $mobile, "$t1.status<" => 6 ]; $this->db->where($where); $this->db->order_by("$t1.id desc"); $this->db->limit(1); $row = $this->db->get()->row_array(); return $row; } //获取交车列表 public function get_finsh($mobile,$page,$size,$count){ $t1 = 'lc_receiver_orders'; //$t2 = 'lc_receiver_order_contracts'; $this->db->select("$t1.*"); $this->db->from($t1); //$this->db->join($t2, "$t2.o_id = $t1.id and $t2.type=3",'left'); //$where = [ // "$t1.mobile" => $mobile, // "$t2.status" => 1, //]; $where = [ "$t1.mobile" => $mobile, "$t1.status" => 6, ]; $this->db->where($where); if($count){ return $this->db->count_all_results(); } $this->db->order_by("$t1.id desc"); 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(); } public function get_status(){ return $this->status_arr; } }