在点计划任务:每日用户表优化就出现“common_member_archive' doesn't exist”。这个问题可能会导致其他计划任务也无妨执行
搜索网上的教程基本是下边这种解决方法:备份数据库然后 运行sql语句
- DELETE FROM `pre_common_setting` WHERE `skey` = 'membersplit';
复制代码
但是经过 Discuz教程网 排查代码发现这个计划任务的执行并没有判断 membersplit ,所以上述方法无法解决问题
执行错误的代码在:source\class\table\table_common_member.php
- if(DB::query($movesql, array('common_member_archive', 'common_member'), false, true)) {
- DB::query($deletesql, array('common_member'), false, true);
- }
- if(DB::query($movesql, array('common_member_profile_archive', 'common_member_profile'), false, true)) {
- DB::query($deletesql, array('common_member_profile'), false, true);
- }
- if(DB::query($movesql, array('common_member_field_forum_archive', 'common_member_field_forum'), false, true)) {
- DB::query($deletesql, array('common_member_field_forum'), false, true);
- }
- if(DB::query($movesql, array('common_member_field_home_archive', 'common_member_field_home'), false, true)) {
- DB::query($deletesql, array('common_member_field_home'), false, true);
- }
- if(DB::query($movesql, array('common_member_status_archive', 'common_member_status'), false, true)) {
- DB::query($deletesql, array('common_member_status'), false, true);
- }
- if(DB::query($movesql, array('common_member_count_archive', 'common_member_count'), false, true)) {
- DB::query($deletesql, array('common_member_count'), false, true);
- }
复制代码
计划任务执行时因为 common_member_archive 等表不存在,所以实际解决办法应该是建立这些表,处理方法如下:
访问后台:admin.php?frames=yes&action=membersplit&operation=manage ,点击立即优化
OK,问题解决
本教程由Discuz教程网(www.discuz.1314study.com)原创发布,转载请以链接标明出处
|