Mailtemplates.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. namespace app\common\model;
  3. use think\facade\Db;
  4. /**
  5. * ============================================================================
  6. *
  7. * ============================================================================
  8. *
  9. * ----------------------------------------------------------------------------
  10. *
  11. * ============================================================================
  12. * 数据层模型
  13. */
  14. class Mailtemplates extends BaseModel {
  15. /**
  16. * 取单条信息
  17. * @access public
  18. * @author csdeshang
  19. * @param array $condition 条件
  20. * @param string $fields 字段
  21. */
  22. public function getTplInfo($condition = array(), $fields = '*') {
  23. return Db::name('mailmsgtemlates')->where($condition)->field($fields)->find();
  24. }
  25. /**
  26. * 模板列表
  27. * @access public
  28. * @author csdeshang
  29. * @param array $condition 检索条件
  30. * @return array 数组形式的返回结果
  31. */
  32. public function getTplList($condition = array()) {
  33. return Db::name('mailmsgtemlates')->where($condition)->select()->toArray();
  34. }
  35. /**
  36. * 编辑模板
  37. * @access public
  38. * @author csdeshang
  39. * @param type $data 参数内容
  40. * @param type $condition 条件
  41. * @return type
  42. */
  43. public function editTpl($data = array(), $condition = array()) {
  44. return Db::name('mailmsgtemlates')->where($condition)->update($data);
  45. }
  46. }