Membermsgsetting.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. namespace app\common\model;
  3. use think\facade\Db;
  4. /**
  5. * ============================================================================
  6. *
  7. * ============================================================================
  8. *
  9. * ----------------------------------------------------------------------------
  10. *
  11. * ============================================================================
  12. * 数据层模型
  13. */
  14. class Membermsgsetting extends BaseModel
  15. {
  16. public $page_info;
  17. /**
  18. * 用户消息模板列表
  19. * @access public
  20. * @author csdeshang
  21. * @param array $condition 条件
  22. * @param string $field 字段
  23. * @param number $pagesize 分页
  24. * @param string $order 排序
  25. * @return array
  26. */
  27. public function getMembermsgsettingList($condition, $field = '*', $pagesize = 0, $order = 'membermt_code asc')
  28. {
  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. {
  47. return Db::name('membermsgsetting')->field($field)->where($condition)->find();
  48. }
  49. /**
  50. * 编辑用户消息模板
  51. * @access public
  52. * @author csdeshang
  53. * @param type $data 数据
  54. * @return type
  55. */
  56. public function addMembermsgsettingAll($data)
  57. {
  58. return Db::name('membermsgsetting')->insertAll($data);
  59. }
  60. }