LinksModel.class.php 650 B

123456789101112131415161718192021222324252627
  1. <?php
  2. /**
  3. * 洛阳赤炎鹰网络科技有限公司
  4. * https://www.cyyvip.com
  5. * Copyright (c) 2022 赤店商城 All rights reserved.
  6. */
  7. namespace Common\Model;
  8. use Common\Model\CommonModel;
  9. class LinksModel extends CommonModel
  10. {
  11. //自动验证
  12. protected $_validate = array(
  13. //array(验证字段,验证规则,错误提示,验证条件,附加规则,验证时间)
  14. array('link_name', 'require', '链接名称不能为空!', 1, 'regex', 3),
  15. array('link_url', 'require', '链接地址不能为空!', 1, 'regex', 3),
  16. );
  17. protected function _before_write(&$data) {
  18. parent::_before_write($data);
  19. }
  20. }