diff --git a/app/Console/Tasks/DeliverTask.php b/app/Console/Tasks/DeliverTask.php index ad7c846b..874401a4 100644 --- a/app/Console/Tasks/DeliverTask.php +++ b/app/Console/Tasks/DeliverTask.php @@ -248,12 +248,12 @@ class DeliverTask extends Task { $itemType = TaskModel::TYPE_DELIVER; $status = TaskModel::STATUS_PENDING; - $tryCount = self::TRY_COUNT; + $createTime = strtotime('-3 days'); return TaskModel::query() ->where('item_type = :item_type:', ['item_type' => $itemType]) ->andWhere('status = :status:', ['status' => $status]) - ->andWhere('try_count < :try_count:', ['try_count' => $tryCount + 1]) + ->andWhere('create_time > :create_time:', ['create_time' => $createTime]) ->orderBy('priority ASC') ->limit($limit) ->execute(); diff --git a/app/Console/Tasks/NoticeTask.php b/app/Console/Tasks/NoticeTask.php index 06841554..b736b80c 100644 --- a/app/Console/Tasks/NoticeTask.php +++ b/app/Console/Tasks/NoticeTask.php @@ -125,12 +125,12 @@ class NoticeTask extends Task $status = TaskModel::STATUS_PENDING; - $tryCount = self::TRY_COUNT; + $createTime = strtotime('-1 days'); return TaskModel::query() ->inWhere('item_type', $itemTypes) ->andWhere('status = :status:', ['status' => $status]) - ->andWhere('try_count < :try_count:', ['try_count' => $tryCount + 1]) + ->andWhere('create_time > :create_time:', ['create_time' => $createTime]) ->orderBy('priority ASC') ->limit($limit) ->execute(); diff --git a/app/Console/Tasks/RefundTask.php b/app/Console/Tasks/RefundTask.php index 1697a4e1..7529c242 100644 --- a/app/Console/Tasks/RefundTask.php +++ b/app/Console/Tasks/RefundTask.php @@ -296,12 +296,12 @@ class RefundTask extends Task { $itemType = TaskModel::TYPE_REFUND; $status = TaskModel::STATUS_PENDING; - $tryCount = self::TRY_COUNT; + $createTime = strtotime('-3 days'); return TaskModel::query() ->where('item_type = :item_type:', ['item_type' => $itemType]) ->andWhere('status = :status:', ['status' => $status]) - ->andWhere('try_count < :try_count:', ['try_count' => $tryCount + 1]) + ->andWhere('create_time > :create_time:', ['create_time' => $createTime]) ->orderBy('priority ASC') ->limit($limit) ->execute(); diff --git a/db/migrations/20210105023511_schema_202101051030.php b/db/migrations/20210105023511_schema_202101051030.php new file mode 100644 index 00000000..c56395ce --- /dev/null +++ b/db/migrations/20210105023511_schema_202101051030.php @@ -0,0 +1,16 @@ +table('kg_task') + ->addIndex(['create_time'], [ + 'name' => 'create_time', + 'unique' => false, + ]) + ->save(); + } + +} diff --git a/db/migrations/schema.php b/db/migrations/schema.php index 5dbbff50..e564699d 100644 --- a/db/migrations/schema.php +++ b/db/migrations/schema.php @@ -218,15 +218,15 @@ return array( ), 'indexes' => array( - 'PRIMARY' => + 'email' => array( 1 => array( 'Table' => 'kg_account', - 'Non_unique' => '0', - 'Key_name' => 'PRIMARY', + 'Non_unique' => '1', + 'Key_name' => 'email', 'Seq_in_index' => '1', - 'Column_name' => 'id', + 'Column_name' => 'email', 'Collation' => 'A', 'Sub_part' => NULL, 'Packed' => NULL, @@ -254,15 +254,15 @@ return array( 'Index_comment' => '', ), ), - 'email' => + 'PRIMARY' => array( 1 => array( 'Table' => 'kg_account', - 'Non_unique' => '1', - 'Key_name' => 'email', + 'Non_unique' => '0', + 'Key_name' => 'PRIMARY', 'Seq_in_index' => '1', - 'Column_name' => 'email', + 'Column_name' => 'id', 'Collation' => 'A', 'Sub_part' => NULL, 'Packed' => NULL, @@ -1428,24 +1428,6 @@ return array( ), 'indexes' => array( - 'PRIMARY' => - array( - 1 => - array( - 'Table' => 'kg_chapter', - 'Non_unique' => '0', - 'Key_name' => 'PRIMARY', - 'Seq_in_index' => '1', - 'Column_name' => 'id', - 'Collation' => 'A', - 'Sub_part' => NULL, - 'Packed' => NULL, - 'Null' => '', - 'Index_type' => 'BTREE', - 'Comment' => '', - 'Index_comment' => '', - ), - ), 'course_id' => array( 1 => @@ -1482,6 +1464,24 @@ return array( 'Index_comment' => '', ), ), + 'PRIMARY' => + array( + 1 => + array( + 'Table' => 'kg_chapter', + 'Non_unique' => '0', + 'Key_name' => 'PRIMARY', + 'Seq_in_index' => '1', + 'Column_name' => 'id', + 'Collation' => 'A', + 'Sub_part' => NULL, + 'Packed' => NULL, + 'Null' => '', + 'Index_type' => 'BTREE', + 'Comment' => '', + 'Index_comment' => '', + ), + ), ), 'foreign_keys' => NULL, ), @@ -1645,24 +1645,6 @@ return array( ), 'indexes' => array( - 'PRIMARY' => - array( - 1 => - array( - 'Table' => 'kg_chapter_like', - 'Non_unique' => '0', - 'Key_name' => 'PRIMARY', - 'Seq_in_index' => '1', - 'Column_name' => 'id', - 'Collation' => 'A', - 'Sub_part' => NULL, - 'Packed' => NULL, - 'Null' => '', - 'Index_type' => 'BTREE', - 'Comment' => '', - 'Index_comment' => '', - ), - ), 'chapter_user' => array( 1 => @@ -1696,6 +1678,24 @@ return array( 'Index_comment' => '', ), ), + 'PRIMARY' => + array( + 1 => + array( + 'Table' => 'kg_chapter_like', + 'Non_unique' => '0', + 'Key_name' => 'PRIMARY', + 'Seq_in_index' => '1', + 'Column_name' => 'id', + 'Collation' => 'A', + 'Sub_part' => NULL, + 'Packed' => NULL, + 'Null' => '', + 'Index_type' => 'BTREE', + 'Comment' => '', + 'Index_comment' => '', + ), + ), ), 'foreign_keys' => NULL, ), @@ -1931,15 +1931,15 @@ return array( ), 'indexes' => array( - 'PRIMARY' => + 'chapter_id' => array( 1 => array( 'Table' => 'kg_chapter_live', - 'Non_unique' => '0', - 'Key_name' => 'PRIMARY', + 'Non_unique' => '1', + 'Key_name' => 'chapter_id', 'Seq_in_index' => '1', - 'Column_name' => 'id', + 'Column_name' => 'chapter_id', 'Collation' => 'A', 'Sub_part' => NULL, 'Packed' => NULL, @@ -1967,15 +1967,15 @@ return array( 'Index_comment' => '', ), ), - 'chapter_id' => + 'PRIMARY' => array( 1 => array( 'Table' => 'kg_chapter_live', - 'Non_unique' => '1', - 'Key_name' => 'chapter_id', + 'Non_unique' => '0', + 'Key_name' => 'PRIMARY', 'Seq_in_index' => '1', - 'Column_name' => 'chapter_id', + 'Column_name' => 'id', 'Collation' => 'A', 'Sub_part' => NULL, 'Packed' => NULL, @@ -2148,24 +2148,6 @@ return array( ), 'indexes' => array( - 'PRIMARY' => - array( - 1 => - array( - 'Table' => 'kg_chapter_read', - 'Non_unique' => '0', - 'Key_name' => 'PRIMARY', - 'Seq_in_index' => '1', - 'Column_name' => 'id', - 'Collation' => 'A', - 'Sub_part' => NULL, - 'Packed' => NULL, - 'Null' => '', - 'Index_type' => 'BTREE', - 'Comment' => '', - 'Index_comment' => '', - ), - ), 'chapter_id' => array( 1 => @@ -2202,6 +2184,24 @@ return array( 'Index_comment' => '', ), ), + 'PRIMARY' => + array( + 1 => + array( + 'Table' => 'kg_chapter_read', + 'Non_unique' => '0', + 'Key_name' => 'PRIMARY', + 'Seq_in_index' => '1', + 'Column_name' => 'id', + 'Collation' => 'A', + 'Sub_part' => NULL, + 'Packed' => NULL, + 'Null' => '', + 'Index_type' => 'BTREE', + 'Comment' => '', + 'Index_comment' => '', + ), + ), ), 'foreign_keys' => NULL, ), @@ -2509,24 +2509,6 @@ return array( ), 'indexes' => array( - 'PRIMARY' => - array( - 1 => - array( - 'Table' => 'kg_chapter_user', - 'Non_unique' => '0', - 'Key_name' => 'PRIMARY', - 'Seq_in_index' => '1', - 'Column_name' => 'id', - 'Collation' => 'A', - 'Sub_part' => NULL, - 'Packed' => NULL, - 'Null' => '', - 'Index_type' => 'BTREE', - 'Comment' => '', - 'Index_comment' => '', - ), - ), 'chapter_user' => array( 1 => @@ -2593,6 +2575,24 @@ return array( 'Index_comment' => '', ), ), + 'PRIMARY' => + array( + 1 => + array( + 'Table' => 'kg_chapter_user', + 'Non_unique' => '0', + 'Key_name' => 'PRIMARY', + 'Seq_in_index' => '1', + 'Column_name' => 'id', + 'Collation' => 'A', + 'Sub_part' => NULL, + 'Packed' => NULL, + 'Null' => '', + 'Index_type' => 'BTREE', + 'Comment' => '', + 'Index_comment' => '', + ), + ), ), 'foreign_keys' => NULL, ), @@ -2780,24 +2780,6 @@ return array( ), 'indexes' => array( - 'PRIMARY' => - array( - 1 => - array( - 'Table' => 'kg_chapter_vod', - 'Non_unique' => '0', - 'Key_name' => 'PRIMARY', - 'Seq_in_index' => '1', - 'Column_name' => 'id', - 'Collation' => 'A', - 'Sub_part' => NULL, - 'Packed' => NULL, - 'Null' => '', - 'Index_type' => 'BTREE', - 'Comment' => '', - 'Index_comment' => '', - ), - ), 'chapter_id' => array( 1 => @@ -2816,6 +2798,24 @@ return array( 'Index_comment' => '', ), ), + 'course_id' => + array( + 1 => + array( + 'Table' => 'kg_chapter_vod', + 'Non_unique' => '1', + 'Key_name' => 'course_id', + 'Seq_in_index' => '1', + 'Column_name' => 'course_id', + 'Collation' => 'A', + 'Sub_part' => NULL, + 'Packed' => NULL, + 'Null' => '', + 'Index_type' => 'BTREE', + 'Comment' => '', + 'Index_comment' => '', + ), + ), 'file_id' => array( 1 => @@ -2834,15 +2834,15 @@ return array( 'Index_comment' => '', ), ), - 'course_id' => + 'PRIMARY' => array( 1 => array( 'Table' => 'kg_chapter_vod', - 'Non_unique' => '1', - 'Key_name' => 'course_id', + 'Non_unique' => '0', + 'Key_name' => 'PRIMARY', 'Seq_in_index' => '1', - 'Column_name' => 'course_id', + 'Column_name' => 'id', 'Collation' => 'A', 'Sub_part' => NULL, 'Packed' => NULL, @@ -3111,24 +3111,6 @@ return array( ), 'indexes' => array( - 'PRIMARY' => - array( - 1 => - array( - 'Table' => 'kg_connect', - 'Non_unique' => '0', - 'Key_name' => 'PRIMARY', - 'Seq_in_index' => '1', - 'Column_name' => 'id', - 'Collation' => 'A', - 'Sub_part' => NULL, - 'Packed' => NULL, - 'Null' => '', - 'Index_type' => 'BTREE', - 'Comment' => '', - 'Index_comment' => '', - ), - ), 'open_provider' => array( 1 => @@ -3162,6 +3144,24 @@ return array( 'Index_comment' => '', ), ), + 'PRIMARY' => + array( + 1 => + array( + 'Table' => 'kg_connect', + 'Non_unique' => '0', + 'Key_name' => 'PRIMARY', + 'Seq_in_index' => '1', + 'Column_name' => 'id', + 'Collation' => 'A', + 'Sub_part' => NULL, + 'Packed' => NULL, + 'Null' => '', + 'Index_type' => 'BTREE', + 'Comment' => '', + 'Index_comment' => '', + ), + ), 'union_provider' => array( 1 => @@ -3616,15 +3616,15 @@ return array( ), 'indexes' => array( - 'PRIMARY' => + 'chapter_id' => array( 1 => array( 'Table' => 'kg_consult', - 'Non_unique' => '0', - 'Key_name' => 'PRIMARY', + 'Non_unique' => '1', + 'Key_name' => 'chapter_id', 'Seq_in_index' => '1', - 'Column_name' => 'id', + 'Column_name' => 'chapter_id', 'Collation' => 'A', 'Sub_part' => NULL, 'Packed' => NULL, @@ -3652,24 +3652,6 @@ return array( 'Index_comment' => '', ), ), - 'chapter_id' => - array( - 1 => - array( - 'Table' => 'kg_consult', - 'Non_unique' => '1', - 'Key_name' => 'chapter_id', - 'Seq_in_index' => '1', - 'Column_name' => 'chapter_id', - 'Collation' => 'A', - 'Sub_part' => NULL, - 'Packed' => NULL, - 'Null' => '', - 'Index_type' => 'BTREE', - 'Comment' => '', - 'Index_comment' => '', - ), - ), 'owner_id' => array( 1 => @@ -3688,6 +3670,24 @@ return array( 'Index_comment' => '', ), ), + 'PRIMARY' => + array( + 1 => + array( + 'Table' => 'kg_consult', + 'Non_unique' => '0', + 'Key_name' => 'PRIMARY', + 'Seq_in_index' => '1', + 'Column_name' => 'id', + 'Collation' => 'A', + 'Sub_part' => NULL, + 'Packed' => NULL, + 'Null' => '', + 'Index_type' => 'BTREE', + 'Comment' => '', + 'Index_comment' => '', + ), + ), ), 'foreign_keys' => NULL, ), @@ -3851,24 +3851,6 @@ return array( ), 'indexes' => array( - 'PRIMARY' => - array( - 1 => - array( - 'Table' => 'kg_consult_like', - 'Non_unique' => '0', - 'Key_name' => 'PRIMARY', - 'Seq_in_index' => '1', - 'Column_name' => 'id', - 'Collation' => 'A', - 'Sub_part' => NULL, - 'Packed' => NULL, - 'Null' => '', - 'Index_type' => 'BTREE', - 'Comment' => '', - 'Index_comment' => '', - ), - ), 'consult_user' => array( 1 => @@ -3902,6 +3884,24 @@ return array( 'Index_comment' => '', ), ), + 'PRIMARY' => + array( + 1 => + array( + 'Table' => 'kg_consult_like', + 'Non_unique' => '0', + 'Key_name' => 'PRIMARY', + 'Seq_in_index' => '1', + 'Column_name' => 'id', + 'Collation' => 'A', + 'Sub_part' => NULL, + 'Packed' => NULL, + 'Null' => '', + 'Index_type' => 'BTREE', + 'Comment' => '', + 'Index_comment' => '', + ), + ), ), 'foreign_keys' => NULL, ), @@ -4750,15 +4750,15 @@ return array( ), 'indexes' => array( - 'PRIMARY' => + 'category_id' => array( 1 => array( 'Table' => 'kg_course_category', - 'Non_unique' => '0', - 'Key_name' => 'PRIMARY', + 'Non_unique' => '1', + 'Key_name' => 'category_id', 'Seq_in_index' => '1', - 'Column_name' => 'id', + 'Column_name' => 'category_id', 'Collation' => 'A', 'Sub_part' => NULL, 'Packed' => NULL, @@ -4786,15 +4786,15 @@ return array( 'Index_comment' => '', ), ), - 'category_id' => + 'PRIMARY' => array( 1 => array( 'Table' => 'kg_course_category', - 'Non_unique' => '1', - 'Key_name' => 'category_id', + 'Non_unique' => '0', + 'Key_name' => 'PRIMARY', 'Seq_in_index' => '1', - 'Column_name' => 'category_id', + 'Column_name' => 'id', 'Collation' => 'A', 'Sub_part' => NULL, 'Packed' => NULL, @@ -4967,24 +4967,6 @@ return array( ), 'indexes' => array( - 'PRIMARY' => - array( - 1 => - array( - 'Table' => 'kg_course_favorite', - 'Non_unique' => '0', - 'Key_name' => 'PRIMARY', - 'Seq_in_index' => '1', - 'Column_name' => 'id', - 'Collation' => 'A', - 'Sub_part' => NULL, - 'Packed' => NULL, - 'Null' => '', - 'Index_type' => 'BTREE', - 'Comment' => '', - 'Index_comment' => '', - ), - ), 'course_id' => array( 1 => @@ -5003,6 +4985,24 @@ return array( 'Index_comment' => '', ), ), + 'PRIMARY' => + array( + 1 => + array( + 'Table' => 'kg_course_favorite', + 'Non_unique' => '0', + 'Key_name' => 'PRIMARY', + 'Seq_in_index' => '1', + 'Column_name' => 'id', + 'Collation' => 'A', + 'Sub_part' => NULL, + 'Packed' => NULL, + 'Null' => '', + 'Index_type' => 'BTREE', + 'Comment' => '', + 'Index_comment' => '', + ), + ), 'user_id' => array( 1 => @@ -5136,24 +5136,6 @@ return array( ), 'indexes' => array( - 'PRIMARY' => - array( - 1 => - array( - 'Table' => 'kg_course_package', - 'Non_unique' => '0', - 'Key_name' => 'PRIMARY', - 'Seq_in_index' => '1', - 'Column_name' => 'id', - 'Collation' => 'A', - 'Sub_part' => NULL, - 'Packed' => NULL, - 'Null' => '', - 'Index_type' => 'BTREE', - 'Comment' => '', - 'Index_comment' => '', - ), - ), 'course_id' => array( 1 => @@ -5190,6 +5172,24 @@ return array( 'Index_comment' => '', ), ), + 'PRIMARY' => + array( + 1 => + array( + 'Table' => 'kg_course_package', + 'Non_unique' => '0', + 'Key_name' => 'PRIMARY', + 'Seq_in_index' => '1', + 'Column_name' => 'id', + 'Collation' => 'A', + 'Sub_part' => NULL, + 'Packed' => NULL, + 'Null' => '', + 'Index_type' => 'BTREE', + 'Comment' => '', + 'Index_comment' => '', + ), + ), ), 'foreign_keys' => NULL, ), @@ -5510,24 +5510,6 @@ return array( ), 'indexes' => array( - 'PRIMARY' => - array( - 1 => - array( - 'Table' => 'kg_course_related', - 'Non_unique' => '0', - 'Key_name' => 'PRIMARY', - 'Seq_in_index' => '1', - 'Column_name' => 'id', - 'Collation' => 'A', - 'Sub_part' => NULL, - 'Packed' => NULL, - 'Null' => '', - 'Index_type' => 'BTREE', - 'Comment' => '', - 'Index_comment' => '', - ), - ), 'course_id' => array( 1 => @@ -5546,6 +5528,24 @@ return array( 'Index_comment' => '', ), ), + 'PRIMARY' => + array( + 1 => + array( + 'Table' => 'kg_course_related', + 'Non_unique' => '0', + 'Key_name' => 'PRIMARY', + 'Seq_in_index' => '1', + 'Column_name' => 'id', + 'Collation' => 'A', + 'Sub_part' => NULL, + 'Packed' => NULL, + 'Null' => '', + 'Index_type' => 'BTREE', + 'Comment' => '', + 'Index_comment' => '', + ), + ), ), 'foreign_keys' => NULL, ), @@ -5661,6 +5661,24 @@ return array( ), 'indexes' => array( + 'course_id' => + array( + 1 => + array( + 'Table' => 'kg_course_topic', + 'Non_unique' => '1', + 'Key_name' => 'course_id', + 'Seq_in_index' => '1', + 'Column_name' => 'course_id', + 'Collation' => 'A', + 'Sub_part' => NULL, + 'Packed' => NULL, + 'Null' => '', + 'Index_type' => 'BTREE', + 'Comment' => '', + 'Index_comment' => '', + ), + ), 'PRIMARY' => array( 1 => @@ -5697,24 +5715,6 @@ return array( 'Index_comment' => '', ), ), - 'course_id' => - array( - 1 => - array( - 'Table' => 'kg_course_topic', - 'Non_unique' => '1', - 'Key_name' => 'course_id', - 'Seq_in_index' => '1', - 'Column_name' => 'course_id', - 'Collation' => 'A', - 'Sub_part' => NULL, - 'Packed' => NULL, - 'Null' => '', - 'Index_type' => 'BTREE', - 'Comment' => '', - 'Index_comment' => '', - ), - ), ), 'foreign_keys' => NULL, ), @@ -6046,24 +6046,6 @@ return array( ), 'indexes' => array( - 'PRIMARY' => - array( - 1 => - array( - 'Table' => 'kg_course_user', - 'Non_unique' => '0', - 'Key_name' => 'PRIMARY', - 'Seq_in_index' => '1', - 'Column_name' => 'id', - 'Collation' => 'A', - 'Sub_part' => NULL, - 'Packed' => NULL, - 'Null' => '', - 'Index_type' => 'BTREE', - 'Comment' => '', - 'Index_comment' => '', - ), - ), 'course_id' => array( 1 => @@ -6082,24 +6064,6 @@ return array( 'Index_comment' => '', ), ), - 'user_id' => - array( - 1 => - array( - 'Table' => 'kg_course_user', - 'Non_unique' => '1', - 'Key_name' => 'user_id', - 'Seq_in_index' => '1', - 'Column_name' => 'user_id', - 'Collation' => 'A', - 'Sub_part' => NULL, - 'Packed' => NULL, - 'Null' => '', - 'Index_type' => 'BTREE', - 'Comment' => '', - 'Index_comment' => '', - ), - ), 'course_user' => array( 1 => @@ -6133,6 +6097,42 @@ return array( 'Index_comment' => '', ), ), + 'PRIMARY' => + array( + 1 => + array( + 'Table' => 'kg_course_user', + 'Non_unique' => '0', + 'Key_name' => 'PRIMARY', + 'Seq_in_index' => '1', + 'Column_name' => 'id', + 'Collation' => 'A', + 'Sub_part' => NULL, + 'Packed' => NULL, + 'Null' => '', + 'Index_type' => 'BTREE', + 'Comment' => '', + 'Index_comment' => '', + ), + ), + 'user_id' => + array( + 1 => + array( + 'Table' => 'kg_course_user', + 'Non_unique' => '1', + 'Key_name' => 'user_id', + 'Seq_in_index' => '1', + 'Column_name' => 'user_id', + 'Collation' => 'A', + 'Sub_part' => NULL, + 'Packed' => NULL, + 'Null' => '', + 'Index_type' => 'BTREE', + 'Comment' => '', + 'Index_comment' => '', + ), + ), ), 'foreign_keys' => NULL, ), @@ -6464,24 +6464,6 @@ return array( ), 'indexes' => array( - 'PRIMARY' => - array( - 1 => - array( - 'Table' => 'kg_danmu', - 'Non_unique' => '0', - 'Key_name' => 'PRIMARY', - 'Seq_in_index' => '1', - 'Column_name' => 'id', - 'Collation' => 'A', - 'Sub_part' => NULL, - 'Packed' => NULL, - 'Null' => '', - 'Index_type' => 'BTREE', - 'Comment' => '', - 'Index_comment' => '', - ), - ), 'chapter_id' => array( 1 => @@ -6518,6 +6500,24 @@ return array( 'Index_comment' => '', ), ), + 'PRIMARY' => + array( + 1 => + array( + 'Table' => 'kg_danmu', + 'Non_unique' => '0', + 'Key_name' => 'PRIMARY', + 'Seq_in_index' => '1', + 'Column_name' => 'id', + 'Collation' => 'A', + 'Sub_part' => NULL, + 'Packed' => NULL, + 'Null' => '', + 'Index_type' => 'BTREE', + 'Comment' => '', + 'Index_comment' => '', + ), + ), ), 'foreign_keys' => NULL, ), @@ -7768,24 +7768,6 @@ return array( ), 'indexes' => array( - 'PRIMARY' => - array( - 1 => - array( - 'Table' => 'kg_im_group_user', - 'Non_unique' => '0', - 'Key_name' => 'PRIMARY', - 'Seq_in_index' => '1', - 'Column_name' => 'id', - 'Collation' => 'A', - 'Sub_part' => NULL, - 'Packed' => NULL, - 'Null' => '', - 'Index_type' => 'BTREE', - 'Comment' => '', - 'Index_comment' => '', - ), - ), 'group_id' => array( 1 => @@ -7804,24 +7786,6 @@ return array( 'Index_comment' => '', ), ), - 'user_id' => - array( - 1 => - array( - 'Table' => 'kg_im_group_user', - 'Non_unique' => '1', - 'Key_name' => 'user_id', - 'Seq_in_index' => '1', - 'Column_name' => 'user_id', - 'Collation' => 'A', - 'Sub_part' => NULL, - 'Packed' => NULL, - 'Null' => '', - 'Index_type' => 'BTREE', - 'Comment' => '', - 'Index_comment' => '', - ), - ), 'group_user' => array( 1 => @@ -7855,6 +7819,42 @@ return array( 'Index_comment' => '', ), ), + 'PRIMARY' => + array( + 1 => + array( + 'Table' => 'kg_im_group_user', + 'Non_unique' => '0', + 'Key_name' => 'PRIMARY', + 'Seq_in_index' => '1', + 'Column_name' => 'id', + 'Collation' => 'A', + 'Sub_part' => NULL, + 'Packed' => NULL, + 'Null' => '', + 'Index_type' => 'BTREE', + 'Comment' => '', + 'Index_comment' => '', + ), + ), + 'user_id' => + array( + 1 => + array( + 'Table' => 'kg_im_group_user', + 'Non_unique' => '1', + 'Key_name' => 'user_id', + 'Seq_in_index' => '1', + 'Column_name' => 'user_id', + 'Collation' => 'A', + 'Sub_part' => NULL, + 'Packed' => NULL, + 'Null' => '', + 'Index_type' => 'BTREE', + 'Comment' => '', + 'Index_comment' => '', + ), + ), ), 'foreign_keys' => NULL, ), @@ -8114,24 +8114,6 @@ return array( ), 'indexes' => array( - 'PRIMARY' => - array( - 1 => - array( - 'Table' => 'kg_im_message', - 'Non_unique' => '0', - 'Key_name' => 'PRIMARY', - 'Seq_in_index' => '1', - 'Column_name' => 'id', - 'Collation' => 'A', - 'Sub_part' => NULL, - 'Packed' => NULL, - 'Null' => '', - 'Index_type' => 'BTREE', - 'Comment' => '', - 'Index_comment' => '', - ), - ), 'chat_id' => array( 1 => @@ -8150,6 +8132,24 @@ return array( 'Index_comment' => '', ), ), + 'PRIMARY' => + array( + 1 => + array( + 'Table' => 'kg_im_message', + 'Non_unique' => '0', + 'Key_name' => 'PRIMARY', + 'Seq_in_index' => '1', + 'Column_name' => 'id', + 'Collation' => 'A', + 'Sub_part' => NULL, + 'Packed' => NULL, + 'Null' => '', + 'Index_type' => 'BTREE', + 'Comment' => '', + 'Index_comment' => '', + ), + ), 'receiver' => array( 1 => @@ -8436,24 +8436,6 @@ return array( 'Index_comment' => '', ), ), - 'sender_id' => - array( - 1 => - array( - 'Table' => 'kg_im_notice', - 'Non_unique' => '1', - 'Key_name' => 'sender_id', - 'Seq_in_index' => '1', - 'Column_name' => 'sender_id', - 'Collation' => 'A', - 'Sub_part' => NULL, - 'Packed' => NULL, - 'Null' => '', - 'Index_type' => 'BTREE', - 'Comment' => '', - 'Index_comment' => '', - ), - ), 'receiver_id' => array( 1 => @@ -8472,6 +8454,24 @@ return array( 'Index_comment' => '', ), ), + 'sender_id' => + array( + 1 => + array( + 'Table' => 'kg_im_notice', + 'Non_unique' => '1', + 'Key_name' => 'sender_id', + 'Seq_in_index' => '1', + 'Column_name' => 'sender_id', + 'Collation' => 'A', + 'Sub_part' => NULL, + 'Packed' => NULL, + 'Null' => '', + 'Index_type' => 'BTREE', + 'Comment' => '', + 'Index_comment' => '', + ), + ), ), 'foreign_keys' => NULL, ), @@ -9128,6 +9128,39 @@ return array( ), 'indexes' => array( + 'chapter_user' => + array( + 1 => + array( + 'Table' => 'kg_learning', + 'Non_unique' => '1', + 'Key_name' => 'chapter_user', + 'Seq_in_index' => '1', + 'Column_name' => 'chapter_id', + 'Collation' => 'A', + 'Sub_part' => NULL, + 'Packed' => NULL, + 'Null' => '', + 'Index_type' => 'BTREE', + 'Comment' => '', + 'Index_comment' => '', + ), + 2 => + array( + 'Table' => 'kg_learning', + 'Non_unique' => '1', + 'Key_name' => 'chapter_user', + 'Seq_in_index' => '2', + 'Column_name' => 'user_id', + 'Collation' => 'A', + 'Sub_part' => NULL, + 'Packed' => NULL, + 'Null' => '', + 'Index_type' => 'BTREE', + 'Comment' => '', + 'Index_comment' => '', + ), + ), 'PRIMARY' => array( 1 => @@ -9164,39 +9197,6 @@ return array( 'Index_comment' => '', ), ), - 'chapter_user' => - array( - 1 => - array( - 'Table' => 'kg_learning', - 'Non_unique' => '1', - 'Key_name' => 'chapter_user', - 'Seq_in_index' => '1', - 'Column_name' => 'chapter_id', - 'Collation' => 'A', - 'Sub_part' => NULL, - 'Packed' => NULL, - 'Null' => '', - 'Index_type' => 'BTREE', - 'Comment' => '', - 'Index_comment' => '', - ), - 2 => - array( - 'Table' => 'kg_learning', - 'Non_unique' => '1', - 'Key_name' => 'chapter_user', - 'Seq_in_index' => '2', - 'Column_name' => 'user_id', - 'Collation' => 'A', - 'Sub_part' => NULL, - 'Packed' => NULL, - 'Null' => '', - 'Index_type' => 'BTREE', - 'Comment' => '', - 'Index_comment' => '', - ), - ), ), 'foreign_keys' => NULL, ), @@ -9914,6 +9914,24 @@ return array( ), 'indexes' => array( + 'active_time' => + array( + 1 => + array( + 'Table' => 'kg_online', + 'Non_unique' => '1', + 'Key_name' => 'active_time', + 'Seq_in_index' => '1', + 'Column_name' => 'active_time', + 'Collation' => 'A', + 'Sub_part' => NULL, + 'Packed' => NULL, + 'Null' => '', + 'Index_type' => 'BTREE', + 'Comment' => '', + 'Index_comment' => '', + ), + ), 'PRIMARY' => array( 1 => @@ -9950,24 +9968,6 @@ return array( 'Index_comment' => '', ), ), - 'active_time' => - array( - 1 => - array( - 'Table' => 'kg_online', - 'Non_unique' => '1', - 'Key_name' => 'active_time', - 'Seq_in_index' => '1', - 'Column_name' => 'active_time', - 'Collation' => 'A', - 'Sub_part' => NULL, - 'Packed' => NULL, - 'Null' => '', - 'Index_type' => 'BTREE', - 'Comment' => '', - 'Index_comment' => '', - ), - ), ), 'foreign_keys' => NULL, ), @@ -10323,42 +10323,6 @@ return array( ), 'indexes' => array( - 'PRIMARY' => - array( - 1 => - array( - 'Table' => 'kg_order', - 'Non_unique' => '0', - 'Key_name' => 'PRIMARY', - 'Seq_in_index' => '1', - 'Column_name' => 'id', - 'Collation' => 'A', - 'Sub_part' => NULL, - 'Packed' => NULL, - 'Null' => '', - 'Index_type' => 'BTREE', - 'Comment' => '', - 'Index_comment' => '', - ), - ), - 'sn' => - array( - 1 => - array( - 'Table' => 'kg_order', - 'Non_unique' => '1', - 'Key_name' => 'sn', - 'Seq_in_index' => '1', - 'Column_name' => 'sn', - 'Collation' => 'A', - 'Sub_part' => NULL, - 'Packed' => NULL, - 'Null' => '', - 'Index_type' => 'BTREE', - 'Comment' => '', - 'Index_comment' => '', - ), - ), 'item' => array( 1 => @@ -10410,6 +10374,42 @@ return array( 'Index_comment' => '', ), ), + 'PRIMARY' => + array( + 1 => + array( + 'Table' => 'kg_order', + 'Non_unique' => '0', + 'Key_name' => 'PRIMARY', + 'Seq_in_index' => '1', + 'Column_name' => 'id', + 'Collation' => 'A', + 'Sub_part' => NULL, + 'Packed' => NULL, + 'Null' => '', + 'Index_type' => 'BTREE', + 'Comment' => '', + 'Index_comment' => '', + ), + ), + 'sn' => + array( + 1 => + array( + 'Table' => 'kg_order', + 'Non_unique' => '1', + 'Key_name' => 'sn', + 'Seq_in_index' => '1', + 'Column_name' => 'sn', + 'Collation' => 'A', + 'Sub_part' => NULL, + 'Packed' => NULL, + 'Null' => '', + 'Index_type' => 'BTREE', + 'Comment' => '', + 'Index_comment' => '', + ), + ), ), 'foreign_keys' => NULL, ), @@ -10525,24 +10525,6 @@ return array( ), 'indexes' => array( - 'PRIMARY' => - array( - 1 => - array( - 'Table' => 'kg_order_status', - 'Non_unique' => '0', - 'Key_name' => 'PRIMARY', - 'Seq_in_index' => '1', - 'Column_name' => 'id', - 'Collation' => 'A', - 'Sub_part' => NULL, - 'Packed' => NULL, - 'Null' => '', - 'Index_type' => 'BTREE', - 'Comment' => '', - 'Index_comment' => '', - ), - ), 'order_id' => array( 1 => @@ -10561,6 +10543,24 @@ return array( 'Index_comment' => '', ), ), + 'PRIMARY' => + array( + 1 => + array( + 'Table' => 'kg_order_status', + 'Non_unique' => '0', + 'Key_name' => 'PRIMARY', + 'Seq_in_index' => '1', + 'Column_name' => 'id', + 'Collation' => 'A', + 'Sub_part' => NULL, + 'Packed' => NULL, + 'Null' => '', + 'Index_type' => 'BTREE', + 'Comment' => '', + 'Index_comment' => '', + ), + ), ), 'foreign_keys' => NULL, ), @@ -11374,33 +11374,15 @@ return array( ), 'indexes' => array( - 'PRIMARY' => - array( - 1 => - array( - 'Table' => 'kg_refund', - 'Non_unique' => '0', - 'Key_name' => 'PRIMARY', - 'Seq_in_index' => '1', - 'Column_name' => 'id', - 'Collation' => 'A', - 'Sub_part' => NULL, - 'Packed' => NULL, - 'Null' => '', - 'Index_type' => 'BTREE', - 'Comment' => '', - 'Index_comment' => '', - ), - ), - 'sn' => + 'order_id' => array( 1 => array( 'Table' => 'kg_refund', 'Non_unique' => '1', - 'Key_name' => 'sn', + 'Key_name' => 'order_id', 'Seq_in_index' => '1', - 'Column_name' => 'sn', + 'Column_name' => 'order_id', 'Collation' => 'A', 'Sub_part' => NULL, 'Packed' => NULL, @@ -11428,15 +11410,33 @@ return array( 'Index_comment' => '', ), ), - 'order_id' => + 'PRIMARY' => + array( + 1 => + array( + 'Table' => 'kg_refund', + 'Non_unique' => '0', + 'Key_name' => 'PRIMARY', + 'Seq_in_index' => '1', + 'Column_name' => 'id', + 'Collation' => 'A', + 'Sub_part' => NULL, + 'Packed' => NULL, + 'Null' => '', + 'Index_type' => 'BTREE', + 'Comment' => '', + 'Index_comment' => '', + ), + ), + 'sn' => array( 1 => array( 'Table' => 'kg_refund', 'Non_unique' => '1', - 'Key_name' => 'order_id', + 'Key_name' => 'sn', 'Seq_in_index' => '1', - 'Column_name' => 'order_id', + 'Column_name' => 'sn', 'Collation' => 'A', 'Sub_part' => NULL, 'Packed' => NULL, @@ -11778,15 +11778,15 @@ return array( ), 'indexes' => array( - 'PRIMARY' => + 'chapter_id' => array( 1 => array( 'Table' => 'kg_resource', - 'Non_unique' => '0', - 'Key_name' => 'PRIMARY', + 'Non_unique' => '1', + 'Key_name' => 'chapter_id', 'Seq_in_index' => '1', - 'Column_name' => 'id', + 'Column_name' => 'chapter_id', 'Collation' => 'A', 'Sub_part' => NULL, 'Packed' => NULL, @@ -11814,15 +11814,15 @@ return array( 'Index_comment' => '', ), ), - 'chapter_id' => + 'PRIMARY' => array( 1 => array( 'Table' => 'kg_resource', - 'Non_unique' => '1', - 'Key_name' => 'chapter_id', + 'Non_unique' => '0', + 'Key_name' => 'PRIMARY', 'Seq_in_index' => '1', - 'Column_name' => 'chapter_id', + 'Column_name' => 'id', 'Collation' => 'A', 'Sub_part' => NULL, 'Packed' => NULL, @@ -12211,24 +12211,6 @@ return array( ), 'indexes' => array( - 'PRIMARY' => - array( - 1 => - array( - 'Table' => 'kg_review', - 'Non_unique' => '0', - 'Key_name' => 'PRIMARY', - 'Seq_in_index' => '1', - 'Column_name' => 'id', - 'Collation' => 'A', - 'Sub_part' => NULL, - 'Packed' => NULL, - 'Null' => '', - 'Index_type' => 'BTREE', - 'Comment' => '', - 'Index_comment' => '', - ), - ), 'course_id' => array( 1 => @@ -12265,6 +12247,24 @@ return array( 'Index_comment' => '', ), ), + 'PRIMARY' => + array( + 1 => + array( + 'Table' => 'kg_review', + 'Non_unique' => '0', + 'Key_name' => 'PRIMARY', + 'Seq_in_index' => '1', + 'Column_name' => 'id', + 'Collation' => 'A', + 'Sub_part' => NULL, + 'Packed' => NULL, + 'Null' => '', + 'Index_type' => 'BTREE', + 'Comment' => '', + 'Index_comment' => '', + ), + ), ), 'foreign_keys' => NULL, ), @@ -13605,7 +13605,7 @@ return array( 'CHARACTER_SET_NAME' => NULL, 'COLLATION_NAME' => NULL, 'COLUMN_TYPE' => 'int unsigned', - 'COLUMN_KEY' => '', + 'COLUMN_KEY' => 'MUL', 'EXTRA' => '', 'PRIVILEGES' => 'select,insert,update,references', 'COLUMN_COMMENT' => '创建时间', @@ -13639,6 +13639,24 @@ return array( ), 'indexes' => array( + 'create_time' => + array( + 1 => + array( + 'Table' => 'kg_task', + 'Non_unique' => '1', + 'Key_name' => 'create_time', + 'Seq_in_index' => '1', + 'Column_name' => 'create_time', + 'Collation' => 'A', + 'Sub_part' => NULL, + 'Packed' => NULL, + 'Null' => '', + 'Index_type' => 'BTREE', + 'Comment' => '', + 'Index_comment' => '', + ), + ), 'PRIMARY' => array( 1 => @@ -14217,33 +14235,15 @@ return array( ), 'indexes' => array( - 'PRIMARY' => - array( - 1 => - array( - 'Table' => 'kg_trade', - 'Non_unique' => '0', - 'Key_name' => 'PRIMARY', - 'Seq_in_index' => '1', - 'Column_name' => 'id', - 'Collation' => 'A', - 'Sub_part' => NULL, - 'Packed' => NULL, - 'Null' => '', - 'Index_type' => 'BTREE', - 'Comment' => '', - 'Index_comment' => '', - ), - ), - 'sn' => + 'order_id' => array( 1 => array( 'Table' => 'kg_trade', 'Non_unique' => '1', - 'Key_name' => 'sn', + 'Key_name' => 'order_id', 'Seq_in_index' => '1', - 'Column_name' => 'sn', + 'Column_name' => 'order_id', 'Collation' => 'A', 'Sub_part' => NULL, 'Packed' => NULL, @@ -14271,15 +14271,33 @@ return array( 'Index_comment' => '', ), ), - 'order_id' => + 'PRIMARY' => + array( + 1 => + array( + 'Table' => 'kg_trade', + 'Non_unique' => '0', + 'Key_name' => 'PRIMARY', + 'Seq_in_index' => '1', + 'Column_name' => 'id', + 'Collation' => 'A', + 'Sub_part' => NULL, + 'Packed' => NULL, + 'Null' => '', + 'Index_type' => 'BTREE', + 'Comment' => '', + 'Index_comment' => '', + ), + ), + 'sn' => array( 1 => array( 'Table' => 'kg_trade', 'Non_unique' => '1', - 'Key_name' => 'order_id', + 'Key_name' => 'sn', 'Seq_in_index' => '1', - 'Column_name' => 'order_id', + 'Column_name' => 'sn', 'Collation' => 'A', 'Sub_part' => NULL, 'Packed' => NULL, @@ -14699,24 +14717,6 @@ return array( ), 'indexes' => array( - 'PRIMARY' => - array( - 1 => - array( - 'Table' => 'kg_upload', - 'Non_unique' => '0', - 'Key_name' => 'PRIMARY', - 'Seq_in_index' => '1', - 'Column_name' => 'id', - 'Collation' => 'A', - 'Sub_part' => NULL, - 'Packed' => NULL, - 'Null' => '', - 'Index_type' => 'BTREE', - 'Comment' => '', - 'Index_comment' => '', - ), - ), 'md5' => array( 1 => @@ -14735,6 +14735,24 @@ return array( 'Index_comment' => '', ), ), + 'PRIMARY' => + array( + 1 => + array( + 'Table' => 'kg_upload', + 'Non_unique' => '0', + 'Key_name' => 'PRIMARY', + 'Seq_in_index' => '1', + 'Column_name' => 'id', + 'Collation' => 'A', + 'Sub_part' => NULL, + 'Packed' => NULL, + 'Null' => '', + 'Index_type' => 'BTREE', + 'Comment' => '', + 'Index_comment' => '', + ), + ), ), 'foreign_keys' => NULL, ), @@ -15210,24 +15228,6 @@ return array( ), 'indexes' => array( - 'PRIMARY' => - array( - 1 => - array( - 'Table' => 'kg_user', - 'Non_unique' => '0', - 'Key_name' => 'PRIMARY', - 'Seq_in_index' => '1', - 'Column_name' => 'id', - 'Collation' => 'A', - 'Sub_part' => NULL, - 'Packed' => NULL, - 'Null' => '', - 'Index_type' => 'BTREE', - 'Comment' => '', - 'Index_comment' => '', - ), - ), 'name' => array( 1 => @@ -15246,6 +15246,24 @@ return array( 'Index_comment' => '', ), ), + 'PRIMARY' => + array( + 1 => + array( + 'Table' => 'kg_user', + 'Non_unique' => '0', + 'Key_name' => 'PRIMARY', + 'Seq_in_index' => '1', + 'Column_name' => 'id', + 'Collation' => 'A', + 'Sub_part' => NULL, + 'Packed' => NULL, + 'Null' => '', + 'Index_type' => 'BTREE', + 'Comment' => '', + 'Index_comment' => '', + ), + ), ), 'foreign_keys' => NULL, ), @@ -16108,24 +16126,6 @@ return array( ), 'indexes' => array( - 'PRIMARY' => - array( - 1 => - array( - 'Table' => 'kg_wechat_subscribe', - 'Non_unique' => '0', - 'Key_name' => 'PRIMARY', - 'Seq_in_index' => '1', - 'Column_name' => 'id', - 'Collation' => 'A', - 'Sub_part' => NULL, - 'Packed' => NULL, - 'Null' => '', - 'Index_type' => 'BTREE', - 'Comment' => '', - 'Index_comment' => '', - ), - ), 'open_id' => array( 1 => @@ -16144,6 +16144,24 @@ return array( 'Index_comment' => '', ), ), + 'PRIMARY' => + array( + 1 => + array( + 'Table' => 'kg_wechat_subscribe', + 'Non_unique' => '0', + 'Key_name' => 'PRIMARY', + 'Seq_in_index' => '1', + 'Column_name' => 'id', + 'Collation' => 'A', + 'Sub_part' => NULL, + 'Packed' => NULL, + 'Null' => '', + 'Index_type' => 'BTREE', + 'Comment' => '', + 'Index_comment' => '', + ), + ), 'user_id' => array( 1 =>