Storenavigation.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <?php
  2. namespace app\common\model;
  3. use think\facade\Db;
  4. /**
  5. * ============================================================================
  6. *
  7. * ============================================================================
  8. * 版权所有 2014-2028 浙江惠利玛产业互联网有限公司,并保留所有权利。
  9. * 网站地址: https://www.valimart.net/
  10. * ----------------------------------------------------------------------------
  11. *
  12. * ============================================================================
  13. * 数据层模型
  14. */
  15. class Storenavigation extends BaseModel
  16. {
  17. protected static function init()
  18. {
  19. parent::init(); // TODO: Change the autogenerated stub
  20. }
  21. /**
  22. * 读取列表
  23. * @access public
  24. * @author csdeshang
  25. * @param type $condition 条件
  26. * @param type $field 字段
  27. * @return type
  28. */
  29. public function getStorenavigationList($condition, $field='*') {
  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. $result = Db::name('storenavigation')->where($condition)->find();
  42. return $result;
  43. }
  44. /**
  45. * 增加
  46. * @access public
  47. * @author csdeshang
  48. * @param array $data 参数内容
  49. * @return bool
  50. */
  51. public function addStorenavigation($data){
  52. return Db::name('storenavigation')->insertGetId($data);
  53. }
  54. /**
  55. * 更新
  56. * @access public
  57. * @author csdeshang
  58. * @param array $update 更新数据
  59. * @param array $condition 条件
  60. * @return bool
  61. */
  62. public function editStorenavigation($update, $condition){
  63. return Db::name('storenavigation')->where($condition)->update($update);
  64. }
  65. /**
  66. * 删除
  67. * @access public
  68. * @author csdeshang
  69. * @param array $condition 条件
  70. * @return bool
  71. */
  72. public function delStorenavigation($condition){
  73. return Db::name('storenavigation')->where($condition)->delete();
  74. }
  75. }