Storeextend.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <?php
  2. namespace app\common\model;
  3. use think\facade\Db;
  4. /**
  5. * ============================================================================
  6. *
  7. * ============================================================================
  8. *
  9. * ----------------------------------------------------------------------------
  10. *
  11. * ============================================================================
  12. * 数据层模型
  13. */
  14. class Storeextend extends BaseModel {
  15. /**
  16. * 查询店铺扩展信息
  17. * @access public
  18. * @author csdeshang
  19. * @param array $condition 店铺编号
  20. * @param string $field 查询字段
  21. * @return array
  22. */
  23. public function getStoreextendInfo($condition, $field = '*') {
  24. return Db::name('storeextend')->field($field)->where($condition)->find();
  25. }
  26. /**
  27. * 编辑店铺扩展信息
  28. * @access public
  29. * @author csdeshang
  30. * @param type $update 更新数据
  31. * @param type $condition 条件
  32. * @return type
  33. */
  34. public function editStoreextend($data, $condition) {
  35. if (empty($condition)) {
  36. return false;
  37. }
  38. if (is_array($data)) {
  39. $result = Db::name('storeextend')->where($condition)->update($data);
  40. return $result;
  41. } else {
  42. return false;
  43. }
  44. }
  45. /**
  46. * 删除店铺扩展信息
  47. * @access public
  48. * @author csdeshang
  49. * @param type $condition 条件
  50. * @return type
  51. */
  52. public function delStoreextend($condition) {
  53. return Db::name('storeextend')->where($condition)->delete();
  54. }
  55. /**
  56. * 添加店铺扩展信息
  57. * @access public
  58. * @author csdeshang
  59. * @param type $condition 条件
  60. * @return type
  61. */
  62. public function addStoreextend($data) {
  63. return Db::name('storeextend')->insertGetId($data);
  64. }
  65. }