123456789101112131415161718192021222324 |
- <?php
- namespace app\common\model;
- use think\db\Query;
- use think\Model;
- /**
- * @method static Query|static hot($hot=1)
- */
- class SiteMsg extends Model
- {
- protected $autoWriteTimestamp=true;
- protected $updateTime=null;
- public function read(){
- return $this->hasMany(SiteMsgRead::class);
- }
- protected static function init()
- {
- self::afterDelete(function (self $msg){
- $msg->read()->delete();
- });
- }
- }
|