Membermsgsetting.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. namespace app\common\model;
  3. use think\facade\Db;
  4. /**
  5. *
  6. *
  7. * ----------------------------------------------------------------------------
  8. *
  9. * 数据层模型
  10. */
  11. class Membermsgsetting extends BaseModel
  12. {
  13. public $page_info;
  14. /**
  15. * 用户消息模板列表
  16. * @access public
  17. * @author csdeshang
  18. * @param array $condition 条件
  19. * @param string $field 字段
  20. * @param number $pagesize 分页
  21. * @param string $order 排序
  22. * @return array
  23. */
  24. public function getMembermsgsettingList($condition, $field = '*', $pagesize = 0, $order = 'membermt_code asc')
  25. {
  26. if ($pagesize) {
  27. $result = Db::name('membermsgsetting')->field($field)->where($condition)->order($order)->paginate(['list_rows' => $pagesize, 'query' => request()->param()], false);
  28. $this->page_info = $result;
  29. return $result->items();
  30. } else {
  31. return Db::name('membermsgsetting')->field($field)->where($condition)->order($order)->select()->toArray();
  32. }
  33. }
  34. /**
  35. * 用户消息模板详细信息
  36. * @access public
  37. * @author csdeshang
  38. * @param array $condition 条件
  39. * @param string $field 字段
  40. * @return array
  41. */
  42. public function getMembermsgsettingInfo($condition, $field = '*')
  43. {
  44. return Db::name('membermsgsetting')->field($field)->where($condition)->find();
  45. }
  46. /**
  47. * 编辑用户消息模板
  48. * @access public
  49. * @author csdeshang
  50. * @param type $data 数据
  51. * @return type
  52. */
  53. public function addMembermsgsettingAll($data)
  54. {
  55. return Db::name('membermsgsetting')->insertAll($data);
  56. }
  57. }