示例#1
0
 public function actionResult()
 {
     // $Shp_id= $user->PID;
     if (!Yii::$app->request->post()) {
         return $this->goBack();
     }
     $request = Yii::$app->request;
     $out_summ = $request->post('OutSum');
     $inv_id = $request->post('InvId');
     $shp_item = $request->post('Shp_item');
     $crc = $request->post('SignatureValue');
     $crc = strtoupper($crc);
     $my_crc = strtoupper(md5("{$out_summ}:{$inv_id}:{$this->mrh_pass2}:Shp_item={$shp_item}"));
     if ($my_crc != $crc) {
         throw new NotFoundHttpException('bad signature');
     }
     $user = User::findByPid($shp_item);
     $today = $user->date;
     if (date("Y-m-d") > $user->date) {
         $today = date("Y-m-d H:i:s");
     }
     $user->date = date('Y-m-d', strtotime($today . '+ 1 month'));
     $user->save();
     return "OK{$inv_id}\n";
 }