Storenavigation.php 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <?php
  2. namespace app\common\model;
  3. use think\facade\Db;
  4. /**
  5. * ============================================================================
  6. *
  7. * ============================================================================
  8. *
  9. * ----------------------------------------------------------------------------
  10. *
  11. * ============================================================================
  12. * 数据层模型
  13. */
  14. class Storenavigation extends BaseModel
  15. {
  16. protected static function init()
  17. {
  18. parent::init(); // TODO: Change the autogenerated stub
  19. }
  20. /**
  21. * 读取列表
  22. * @access public
  23. * @author csdeshang
  24. * @param type $condition 条件
  25. * @param type $field 字段
  26. * @return type
  27. */
  28. public function getStorenavigationList($condition, $field = '*')
  29. {
  30. $result = Db::name('storenavigation')->field($field)->where($condition)->order('storenav_sort asc')->select()->toArray();
  31. return $result;
  32. }
  33. /**
  34. * 读取单条记录
  35. * @access public
  36. * @author csdeshang
  37. * @param array $condition
  38. * @return array
  39. */
  40. public function getStorenavigationInfo($condition)
  41. {
  42. $result = Db::name('storenavigation')->where($condition)->find();
  43. return $result;
  44. }
  45. /**
  46. * 增加
  47. * @access public
  48. * @author csdeshang
  49. * @param array $data 参数内容
  50. * @return bool
  51. */
  52. public function addStorenavigation($data)
  53. {
  54. return Db::name('storenavigation')->insertGetId($data);
  55. }
  56. /**
  57. * 更新
  58. * @access public
  59. * @author csdeshang
  60. * @param array $update 更新数据
  61. * @param array $condition 条件
  62. * @return bool
  63. */
  64. public function editStorenavigation($update, $condition)
  65. {
  66. return Db::name('storenavigation')->where($condition)->update($update);
  67. }
  68. /**
  69. * 删除
  70. * @access public
  71. * @author csdeshang
  72. * @param array $condition 条件
  73. * @return bool
  74. */
  75. public function delStorenavigation($condition)
  76. {
  77. return Db::name('storenavigation')->where($condition)->delete();
  78. }
  79. }