user card sort

This commit is contained in:
andrey 2021-08-09 18:23:56 +03:00
parent 7d145b8fa6
commit 4c3930f5e6
2 changed files with 6 additions and 2 deletions

View File

@ -152,7 +152,9 @@ class UserCardController extends Controller
public function actionUpdate($id)
{
$model = $this->findModel($id);
if ($model->load(Yii::$app->request->post()) && $model->save()) {
if ($model->load(Yii::$app->request->post())) {
$model->updated_at = date('Y-m-d h:i:s');
$model->save();
return $this->redirect(['view', 'id' => $model->id]);
}

View File

@ -83,7 +83,9 @@ class UserCardSearch extends UserCard
$query->andFilterWhere(['skill.id' => $this->skills]);
$query->orderBy('user_card.created_at DESC');
$query->orderBy('user_card.updated_at DESC');
$query->groupBy('card_skill.card_id');
$sumQuery = clone $query;