| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 | 
							- <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); 
 
- class Model_Stock extends Lin_Model 
 
- {
 
- 	function __construct(){
 
- 	parent::__construct();
 
- 	$this->load->database();
 
- 	$this->table = 'stock';
 
-     $this->load_table('stock');
 
- }
 
-     /** 通过类目查找 */
 
- 	public function get_category($category)
 
- 	{
 
- 		return  $this->find("category = '$category'");	
 
- 	}
 
- 	/** 通过长度查找 */
 
- 	public function get_size($size)
 
- 	{
 
- 		return  $this->find("size = '$size'");	
 
- 	}
 
- 	/** 通过等级查找 */
 
- 	public function get_grade($grade)
 
- 	{
 
- 		return  $this->find("grade = '$grade'");	
 
- 	}
 
- 	/** 通过花型查找 */
 
- 	public function get_lowe($lowe)
 
- 	{
 
- 		return  $this->find("lowe = '$lowe'");	
 
- 	}
 
- 	/** 通过颜色查找 */
 
- 	public function get_color($color)
 
- 	{
 
- 		return  $this->find("color = '$color'");	
 
- 	}
 
- 	/** 通过重量查找 */
 
- 	public function get_weight($weight)
 
- 	{
 
- 		return  $this->find("weight = '$weight'");	
 
- 	}
 
- 	/** 通过等级查找 */
 
- 	public function get_sku($sku)
 
- 	{
 
- 		return  $this->find("sku = '$sku'");	
 
- 	}
 
- 	 /** 通过拼接的数据ID查找 */
 
- 	public function get_number($number)
 
- 	{
 
- 		return  $this->find("number = '$number'");	
 
- 	}
 
- }  //end class
 
 
  |