Storemsgsetting.php 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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 Storemsgsetting extends BaseModel
  16. {
  17. public $page_info;
  18. /**
  19. * 店铺消息接收设置列表
  20. * @access public
  21. * @author csdeshang
  22. * @param type $condition 条件
  23. * @param type $field 字段
  24. * @param type $key 键值
  25. * @param type $pagesize 分页
  26. * @param type $order 排序
  27. * @return type
  28. */
  29. public function getStoremsgsettingList($condition, $field = '*', $key = '', $pagesize = 0, $order = 'storemt_code asc') {
  30. if($pagesize){
  31. $res=Db::name('storemsgsetting')->field($field)->where($condition)->order($order)->paginate(['list_rows'=>$pagesize,'query' => request()->param()],false);
  32. $this->page_info=$res;
  33. $result= $res->items();
  34. }else{
  35. $result= Db::name('storemsgsetting')->field($field)->where($condition)->order($order)->select()->toArray();
  36. }
  37. return ds_change_arraykey($result,$key);
  38. }
  39. /**
  40. * 店铺消息接收设置详细
  41. * @access public
  42. * @author csdeshang
  43. * @param type $condition 条件
  44. * @param type $field 字段
  45. * @return type
  46. */
  47. public function getStoremsgsettingInfo($condition, $field = '*') {
  48. return Db::name('storemsgsetting')->field($field)->where($condition)->find();
  49. }
  50. /**
  51. * 添加店铺模板接收设置
  52. * @access public
  53. * @author csdeshang
  54. * @param array $data 新增数据
  55. * @return bool
  56. */
  57. public function addStoremsgsetting($data) {
  58. return Db::name('storemsgsetting')->insert($data);
  59. }
  60. /**
  61. * 编辑店铺模板接收设置
  62. * @access public
  63. * @author csdeshang
  64. * @param array $data 更新数据
  65. * @return bool
  66. */
  67. public function editStoremsgsetting($data, $condition) {
  68. return Db::name('storemsgsetting')->where($condition)->update($data);
  69. }
  70. }