Example #1
0
 public function czh($zid)
 {
     $origin = Adjust::one($zid);
     $A = array();
     foreach ($origin as $data) {
         $A = TaskController::special_merge($A, json_decode($data['data'], true));
     }
     $new = Adjust::cheating($zid);
     foreach ($new as $data) {
         $B = json_decode($data->data, true);
     }
     $bid = (int) $B[count($B) - 1]['id'];
     $AA = array();
     foreach ($A as $key => $data) {
         $aid = (int) $A[$key]['id'];
         if ($aid >= $bid) {
             $AA[] = $data;
         }
     }
     $A = $AA;
     if (count($A) < count($B)) {
         $B = array_slice($B, count($B) - count($A));
     } elseif (count($A) > count($B)) {
         $A = array_slice($A, count($A) - count($B));
     }
     $AA = array();
     $BB = array();
     foreach ($A as $key => $data) {
         $AA['[' . $key . ']'] = $data;
         $BB['[' . $key . ']'] = $B[$key];
     }
     $origin_json = json_encode($AA);
     $new_json = json_encode($BB);
     $res = TaskController::check_diff_multi($AA, $BB);
     $res = json_encode($res);
     $title = "Cheating detail";
     return view('text', compact('res', 'title', 'zid', 'origin_json', 'new_json'));
 }