TimestampBehavior::class, 'attributes' => [ ActiveRecord::EVENT_BEFORE_INSERT => ['created_at'], ActiveRecord::EVENT_BEFORE_UPDATE => ['updated_at'] ] ] ]; } /** * @inheritdoc */ public function rules() { return [ [['agent_type', 'store_id', 'user_id', 'created_at','town_id', 'province', 'city', 'district','town', 'is_delete', 'status', 'audit_time', 'level_id', 'province_id', 'city_id', 'district_id', 'is_out', 'agent_rate_status'], 'integer'], [['name', 'mobile', 'province_name', 'city_name', 'district_name', 'refuse_desc', 'address'], 'string'], [['agent_rate'], 'number'], [['created_at', 'updated_at'], 'safe'] ]; } /*public function afterSave($insert, $changedAttributes) { parent::afterSave($insert, $changedAttributes); if ($insert) { (new \app\utils\OrderUtil())->shareHolderAutoBecomeShare($this); } }*/ }