示例#1
0
 public function actionBadRecordDelete($id)
 {
     $record = RBadRecord::findOne($id);
     $record->record->delete();
     $this->redirect(['cabinet/bad-record-index']);
 }
示例#2
0
 public function actionBadRecord()
 {
     $post = Yii::$app->request->post();
     $id = $post["id"];
     $RBadRecord = RBadRecord::findOne(["id_item" => $id]);
     if (!$RBadRecord) {
         $RBadRecord = new RBadRecord();
         $RBadRecord->id_item = $id;
         $RBadRecord->date = time();
         $RBadRecord->count = 0;
         $RBadRecord->save();
     }
     $RBadRecord->addRecord();
 }
示例#3
0
 public function getBadRecord()
 {
     return $this->hasOne(RBadRecord::className(), ['id_item' => 'id']);
 }