1234567891011121314151617181920212223242526272829 |
- <?php
- namespace app\admin\model;
- use think\model;
- /**
- * UserRule 模型
- * @controllerUrl 'userRule'
- */
- class UserRule extends model
- {
- protected $autoWriteTimestamp = 'int';
- protected $createTime = 'createtime';
- protected $updateTime = 'updatetime';
- protected static function onAfterInsert($model)
- {
- $pk = $model->getPk();
- $model->where($pk, $model[$pk])->update(['weigh' => $model[$pk]]);
- }
- public function setComponentAttr($value)
- {
- if ($value) $value = str_replace('\\', '/', $value);
- return $value;
- }
- }
|