Storeextend.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?php
  2. namespace app\common\model;
  3. use think\facade\Db;
  4. /**
  5. *
  6. *
  7. * ----------------------------------------------------------------------------
  8. *
  9. * 数据层模型
  10. */
  11. class Storeextend extends BaseModel
  12. {
  13. /**
  14. * 查询店铺扩展信息
  15. * @access public
  16. * @author csdeshang
  17. * @param array $condition 店铺编号
  18. * @param string $field 查询字段
  19. * @return array
  20. */
  21. public function getStoreextendInfo($condition, $field = '*')
  22. {
  23. return Db::name('storeextend')->field($field)->where($condition)->find();
  24. }
  25. /**
  26. * 编辑店铺扩展信息
  27. * @access public
  28. * @author csdeshang
  29. * @param type $update 更新数据
  30. * @param type $condition 条件
  31. * @return type
  32. */
  33. public function editStoreextend($data, $condition)
  34. {
  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. {
  54. return Db::name('storeextend')->where($condition)->delete();
  55. }
  56. /**
  57. * 添加店铺扩展信息
  58. * @access public
  59. * @author csdeshang
  60. * @param type $condition 条件
  61. * @return type
  62. */
  63. public function addStoreextend($data)
  64. {
  65. return Db::name('storeextend')->insertGetId($data);
  66. }
  67. }