Model_stock.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
  2. class Model_Stock extends Lin_Model
  3. {
  4. function __construct(){
  5. parent::__construct();
  6. $this->load->database();
  7. $this->table = 'stock';
  8. $this->load_table('stock');
  9. }
  10. /** 通过类目查找 */
  11. public function get_category($category)
  12. {
  13. return $this->find("category = '$category'");
  14. }
  15. /** 通过长度查找 */
  16. public function get_size($size)
  17. {
  18. return $this->find("size = '$size'");
  19. }
  20. /** 通过等级查找 */
  21. public function get_grade($grade)
  22. {
  23. return $this->find("grade = '$grade'");
  24. }
  25. /** 通过花型查找 */
  26. public function get_lowe($lowe)
  27. {
  28. return $this->find("lowe = '$lowe'");
  29. }
  30. /** 通过颜色查找 */
  31. public function get_color($color)
  32. {
  33. return $this->find("color = '$color'");
  34. }
  35. /** 通过重量查找 */
  36. public function get_weight($weight)
  37. {
  38. return $this->find("weight = '$weight'");
  39. }
  40. /** 通过等级查找 */
  41. public function get_sku($sku)
  42. {
  43. return $this->find("sku = '$sku'");
  44. }
  45. /** 通过拼接的数据ID查找 */
  46. public function get_number($number)
  47. {
  48. return $this->find("number = '$number'");
  49. }
  50. } //end class