Membermsgsetting.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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 Membermsgsetting extends BaseModel
  16. {
  17. public $page_info;
  18. /**
  19. * 用户消息模板列表
  20. * @access public
  21. * @author csdeshang
  22. * @param array $condition 条件
  23. * @param string $field 字段
  24. * @param number $pagesize 分页
  25. * @param string $order 排序
  26. * @return array
  27. */
  28. public function getMembermsgsettingList($condition, $field = '*', $pagesize = 0, $order = 'membermt_code asc') {
  29. if($pagesize){
  30. $result= Db::name('membermsgsetting')->field($field)->where($condition)->order($order)->paginate(['list_rows'=>$pagesize,'query' => request()->param()],false);
  31. $this->page_info=$result;
  32. return $result->items();
  33. }else{
  34. return Db::name('membermsgsetting')->field($field)->where($condition)->order($order)->select()->toArray();
  35. }
  36. }
  37. /**
  38. * 用户消息模板详细信息
  39. * @access public
  40. * @author csdeshang
  41. * @param array $condition 条件
  42. * @param string $field 字段
  43. * @return array
  44. */
  45. public function getMembermsgsettingInfo($condition, $field = '*') {
  46. return Db::name('membermsgsetting')->field($field)->where($condition)->find();
  47. }
  48. /**
  49. * 编辑用户消息模板
  50. * @access public
  51. * @author csdeshang
  52. * @param type $data 数据
  53. * @return type
  54. */
  55. public function addMembermsgsettingAll($data) {
  56. return Db::name('membermsgsetting')->insertAll($data);
  57. }
  58. }