示例#1
0
文件: Content.php 项目: Penton/MoBlog
 public function afterSave($insert, $changedAttributes)
 {
     parent::afterSave($insert, $changedAttributes);
     //更新slug
     if (trim($this->slug) == '') {
         $this->slug = $this->cid;
         Content::updateAll(['slug' => $this->cid], ['cid' => $this->cid]);
     }
 }