ChannelConfig.php 606 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace app\common\model;
  3. use think\Cache;
  4. use think\Db;
  5. /**
  6. * 渠道注册配置表
  7. * @author Administrator
  8. */
  9. class ChannelConfig extends \think\Model
  10. {
  11. protected $pk = 'id';
  12. protected $table = 'nw_channel_config';
  13. protected static function init()
  14. {
  15. Channel::afterInsert(function () {
  16. Cache::clear('channelconfig_cache');
  17. });
  18. Channel::afterUpdate(function () {
  19. Cache::clear('channelconfig_cache');
  20. });
  21. Channel::afterWrite(function () {
  22. Cache::clear('channelconfig_cache');
  23. });
  24. }
  25. }