first commit

This commit is contained in:
pakerpale
2020-06-10 06:19:03 +09:00
commit cd6b5b7832
6081 changed files with 624389 additions and 0 deletions

View File

@@ -0,0 +1,52 @@
<?php defined('BASEPATH') or exit('No direct script access allowed');
class config_model extends CI_Model
{
public $table = 'cm_config';
public function __construct()
{
parent::__construct();
$this->load->database();
}
public function findById($configId)
{
return $this->db->where('Id', $configId)->get($this->table);
}
public function findByCategoryId($categoryId)
{
return $this->db->from($this->table . ' cnf')->where_in('CategoryId', $categoryId);
}
public function findByTypeAndName($configType, $name)
{
return $this->db->from($this->table . ' cnf')->where_in('Type', $configType)->where_in('Name', $name);
}
public function findByTypeAndPostId($configType, $postId)
{
return $this->db->from($this->table . ' cnf')->where_in('Type', $configType)->where_in('PostId', $postId);
}
public function findByTypeAndNameAndPage($configType, $name, $page)
{
return $this->db->from($this->table . ' cnf')->where_in('Type', $configType)
->where_in('Name', $name)->where_in('Page', $page)->order_by('OrderNum');
}
public function findByTypeAndPage($configType, $page)
{
return $this->db->from($this->table . ' cnf')->where_in('Type', $configType)
->where_in('Page', $page)->order_by('OrderNum');
}
public function findByTypeAndNameAndPageAndOrderNum($configType, $name, $page, $order)
{
return $this->db->from($this->table . ' cnf')->where_in('Type', $configType)->where_in('Name', $name)
->where_in('Page', $page)->where_in('OrderNum', $order);
}
}