Contact.php 593 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace app\common\model;
  3. use think\Model;
  4. class Contact extends Model
  5. {
  6. /**
  7. * 读取联系我们信息
  8. *
  9. * @param string $name 系统设置信息名称
  10. * @return array 数组格式的返回结果
  11. */
  12. public function getContact()
  13. {
  14. $result = db('contact')->select();
  15. if (is_array($result) and is_array($result[0])) {
  16. return $result[0];
  17. }
  18. return false;
  19. }
  20. /**
  21. * 修改联系我们信息
  22. */
  23. public function updateContact( $update)
  24. {
  25. return db('contact')->where('id','1')->update($update);
  26. }
  27. }
  28. ?>