store_joinin.model.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <?php
  2. /**
  3. * 店铺入住模型
  4. *
  5. *
  6. *
  7. *
  8. */
  9. defined('InShopNC') or exit('Access Invalid!');
  10. class store_joininModel extends Model{
  11. public function __construct(){
  12. parent::__construct('store_joinin');
  13. }
  14. /**
  15. * 读取列表
  16. * @param array $condition
  17. *
  18. */
  19. public function getList($condition,$page='',$order='',$field='*'){
  20. $result = $this->table('store_joinin')->field($field)->where($condition)->page($page)->order($order)->select();
  21. return $result;
  22. }
  23. /**
  24. * 店铺入住数量
  25. * @param unknown $condition
  26. */
  27. public function getStoreJoininCount($condition) {
  28. return $this->where($condition)->count();
  29. }
  30. /**
  31. * 读取单条记录
  32. * @param array $condition
  33. *
  34. */
  35. public function getOne($condition){
  36. $result = $this->where($condition)->find();
  37. return $result;
  38. }
  39. /*
  40. * 判断是否存在
  41. * @param array $condition
  42. *
  43. */
  44. public function isExist($condition) {
  45. $result = $this->getOne($condition);
  46. if(empty($result)) {
  47. return FALSE;
  48. }
  49. else {
  50. return TRUE;
  51. }
  52. }
  53. /*
  54. * 增加
  55. * @param array $param
  56. * @return bool
  57. */
  58. public function save($param){
  59. return $this->insert($param);
  60. }
  61. /*
  62. * 增加
  63. * @param array $param
  64. * @return bool
  65. */
  66. public function saveAll($param){
  67. return $this->insertAll($param);
  68. }
  69. /*
  70. * 更新
  71. * @param array $update
  72. * @param array $condition
  73. * @return bool
  74. */
  75. public function modify($update, $condition){
  76. return $this->where($condition)->update($update);
  77. }
  78. /*
  79. * 删除
  80. * @param array $condition
  81. * @return bool
  82. */
  83. public function drop($condition){
  84. return $this->where($condition)->delete();
  85. }
  86. /**
  87. * 编辑
  88. * @param array $condition
  89. * @param array $update
  90. * @return bool
  91. */
  92. public function editStoreJoinin($condition, $update) {
  93. return $this->where($condition)->update($update);
  94. }
  95. }