first commit
This commit is contained in:
34
application/models/member_model.php
Executable file
34
application/models/member_model.php
Executable file
@@ -0,0 +1,34 @@
|
||||
<?php defined('BASEPATH') or exit('No direct script access allowed');
|
||||
|
||||
class member_model extends CI_Model
|
||||
{
|
||||
|
||||
public $table = 'member';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->database();
|
||||
}
|
||||
|
||||
public function findById($id)
|
||||
{
|
||||
return $this->db->from($this->table . ' l')->where_in('l.idx', $id)
|
||||
->join('partner p', 'l.partner_idx=p.idx', 'left')
|
||||
->select('p.idx editorId, p.partner_img editorImg, p.main_img editorMainImg, p.partner_name editorName, p.partner_intro editorIntro,
|
||||
l.title, l.head_title, l.sub_title, l.content, l.category_idx categoryId, l.idx, l.main_img mainImg, l.hit_count views, l.like_count likes, l.comment_count comments, l.*');
|
||||
}
|
||||
|
||||
public function findByEditorId($editorId)
|
||||
{
|
||||
return $this->db->from($this->table . ' l')->where_in('l.partner_idx', $editorId)
|
||||
->join('partner p', 'l.partner_idx=p.idx', 'left')
|
||||
->select('p.idx editorId, p.partner_img editorImg, p.main_img editorMainImg, p.partner_name editorName, p.partner_intro editorIntro,
|
||||
l.title, l.head_title, l.sub_title, l.content, l.category_idx categoryId, l.idx, l.main_img mainImg, l.hit_count views, l.like_count likes, l.comment_count comments, l.*');
|
||||
}
|
||||
|
||||
public function findAll($categoryId = null)
|
||||
{
|
||||
return $this->db->from($this->table . ' l');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user