addBehavior( new SoftDelete([ 'field' => 'deleted', 'value' => 1, ]) ); } public function beforeCreate() { $this->create_time = time(); } public function beforeUpdate() { $this->update_time = time(); } public function afterFetch() { $this->market_price = (float)$this->market_price; $this->vip_price = (float)$this->vip_price; } }