瀏覽代碼

[backend] Correction bug initialisation order Product

refactoring
Guillaume Bourgeois 5 年之前
父節點
當前提交
6659153af7
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. +2
    -2
      backend/controllers/ProductController.php

+ 2
- 2
backend/controllers/ProductController.php 查看文件

@@ -112,9 +112,9 @@ class ProductController extends BackendController

if ($model->load(Yii::$app->request->post()) && $model->save()) {
$lastProductOrder = Product::find()->orderBy('order DESC')->one() ;
$lastProductOrder = Product::find()->where('id_producer = :id_producer')->params([':id_producer' => Producer::getId()])->orderBy('order DESC')->one() ;
if($lastProductOrder) {
$model->order = $lastProductOrder->order ++ ;
$model->order = ++ $lastProductOrder->order ;
}
Upload::uploadFile($model, 'photo');

Loading…
取消
儲存