RoleModel.class.php 707 B

1234567891011121314151617181920212223242526
  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 RoleModel extends CommonModel{
  10. //自动验证
  11. protected $_validate = array(
  12. //array(验证字段,验证规则,错误提示,验证条件,附加规则,验证时间)
  13. array('name', 'require', '角色名称不能为空!', 1, 'regex', CommonModel:: MODEL_BOTH ),
  14. );
  15. protected $_auto = array(
  16. array('create_time','time',1,'function'),
  17. array('update_time','time',2,'function'),
  18. );
  19. protected function _before_write(&$data) {
  20. parent::_before_write($data);
  21. }
  22. }