From 6a7b0779a9de6e36cd041dc67ad4c41a98240001 Mon Sep 17 00:00:00 2001 From: linyaostalker <602604991@qq.com> Date: Fri, 29 Nov 2019 14:18:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9antgoods=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../goods/src/controllers/AttributeController.php | 4 +++- vendor/antgoods/goods/src/controllers/BrandController.php | 4 +++- vendor/antgoods/goods/src/controllers/GoodsController.php | 4 +++- .../goods/src/controllers/ShopCategoryController.php | 4 +++- .../antgoods/goods/src/controllers/SupplierController.php | 4 +++- .../antgoods/goods/src/models/searchs/AttributeSearch.php | 2 +- vendor/antgoods/goods/src/models/searchs/BrandSearch.php | 2 +- .../antgoods/goods/src/models/searchs/CategorySearch.php | 2 +- vendor/antgoods/goods/src/models/searchs/GoodsSearch.php | 2 +- .../goods/src/models/searchs/ShopCategorySearch.php | 8 +++++--- .../antgoods/goods/src/models/searchs/SupplierSearch.php | 2 +- 11 files changed, 25 insertions(+), 13 deletions(-) diff --git a/vendor/antgoods/goods/src/controllers/AttributeController.php b/vendor/antgoods/goods/src/controllers/AttributeController.php index 74aea6b..9b7f455 100644 --- a/vendor/antgoods/goods/src/controllers/AttributeController.php +++ b/vendor/antgoods/goods/src/controllers/AttributeController.php @@ -106,7 +106,9 @@ class AttributeController extends Controller */ public function actionDelete($id) { - $this->findModel($id)->delete(); + $model = $this->findModel($id); + $model->is_delete = Attribute::IS_DELETE_YES; + $model->save(); return $this->redirect(['index']); } diff --git a/vendor/antgoods/goods/src/controllers/BrandController.php b/vendor/antgoods/goods/src/controllers/BrandController.php index 35e5f83..8536c3d 100644 --- a/vendor/antgoods/goods/src/controllers/BrandController.php +++ b/vendor/antgoods/goods/src/controllers/BrandController.php @@ -105,7 +105,9 @@ class BrandController extends Controller */ public function actionDelete($id) { - $this->findModel($id)->delete(); + $model = $this->findModel($id); + $model->is_delete = Brand::IS_DELETE_YES; + $model->save(); return $this->redirect(['index']); } diff --git a/vendor/antgoods/goods/src/controllers/GoodsController.php b/vendor/antgoods/goods/src/controllers/GoodsController.php index b239827..6a2040d 100644 --- a/vendor/antgoods/goods/src/controllers/GoodsController.php +++ b/vendor/antgoods/goods/src/controllers/GoodsController.php @@ -140,7 +140,9 @@ class GoodsController extends Controller */ public function actionDelete($id) { - $this->findModel($id)->delete(); + $model = $this->findModel($id); + $model->is_delete = Goods::IS_DELETE_YES; + $model->save(); return $this->redirect(['index']); } diff --git a/vendor/antgoods/goods/src/controllers/ShopCategoryController.php b/vendor/antgoods/goods/src/controllers/ShopCategoryController.php index 2699cf9..b9ea0c3 100644 --- a/vendor/antgoods/goods/src/controllers/ShopCategoryController.php +++ b/vendor/antgoods/goods/src/controllers/ShopCategoryController.php @@ -153,7 +153,9 @@ class ShopCategoryController extends Controller */ public function actionDelete($id) { - $this->findModel($id)->delete(); + $model = $this->findModel($id); + $model->is_delete = ShopCategory::IS_DELETE_YES; + $model->save(); return $this->redirect(['index']); } diff --git a/vendor/antgoods/goods/src/controllers/SupplierController.php b/vendor/antgoods/goods/src/controllers/SupplierController.php index cdc6a80..e3c13db 100644 --- a/vendor/antgoods/goods/src/controllers/SupplierController.php +++ b/vendor/antgoods/goods/src/controllers/SupplierController.php @@ -105,7 +105,9 @@ class SupplierController extends Controller */ public function actionDelete($id) { - $this->findModel($id)->delete(); + $model = $this->findModel($id); + $model->is_delete = Supplier::IS_DELETE_YES; + $model->save(); return $this->redirect(['index']); } diff --git a/vendor/antgoods/goods/src/models/searchs/AttributeSearch.php b/vendor/antgoods/goods/src/models/searchs/AttributeSearch.php index 54e2c1d..24605ce 100644 --- a/vendor/antgoods/goods/src/models/searchs/AttributeSearch.php +++ b/vendor/antgoods/goods/src/models/searchs/AttributeSearch.php @@ -101,7 +101,7 @@ class AttributeSearch extends Attribute */ public function search($params) { - $query = Attribute::find(); + $query = Attribute::find()->where(['is_delete' => Attribute::IS_DELETE_NO]); // add conditions that should always apply here diff --git a/vendor/antgoods/goods/src/models/searchs/BrandSearch.php b/vendor/antgoods/goods/src/models/searchs/BrandSearch.php index f435ae2..be249ca 100644 --- a/vendor/antgoods/goods/src/models/searchs/BrandSearch.php +++ b/vendor/antgoods/goods/src/models/searchs/BrandSearch.php @@ -86,7 +86,7 @@ class BrandSearch extends Brand */ public function search($params) { - $query = Brand::find(); + $query = Brand::find()->where(['is_delete' => Brand::IS_DELETE_NO]); // add conditions that should always apply here diff --git a/vendor/antgoods/goods/src/models/searchs/CategorySearch.php b/vendor/antgoods/goods/src/models/searchs/CategorySearch.php index d8bedf6..c6a84a1 100644 --- a/vendor/antgoods/goods/src/models/searchs/CategorySearch.php +++ b/vendor/antgoods/goods/src/models/searchs/CategorySearch.php @@ -114,7 +114,7 @@ class CategorySearch extends Category */ public function search($params) { - $query = Category::find(); + $query = Category::find()->where(['is_delete' => Category::IS_DELETE_NO]); // add conditions that should always apply here diff --git a/vendor/antgoods/goods/src/models/searchs/GoodsSearch.php b/vendor/antgoods/goods/src/models/searchs/GoodsSearch.php index 3fbd782..0420f7b 100644 --- a/vendor/antgoods/goods/src/models/searchs/GoodsSearch.php +++ b/vendor/antgoods/goods/src/models/searchs/GoodsSearch.php @@ -160,7 +160,7 @@ class GoodsSearch extends Goods */ public function search($params) { - $query = Goods::find(); + $query = Goods::find()->where(['is_delete' => Goods::IS_DELETE_NO]); // add conditions that should always apply here diff --git a/vendor/antgoods/goods/src/models/searchs/ShopCategorySearch.php b/vendor/antgoods/goods/src/models/searchs/ShopCategorySearch.php index fec408d..308a831 100644 --- a/vendor/antgoods/goods/src/models/searchs/ShopCategorySearch.php +++ b/vendor/antgoods/goods/src/models/searchs/ShopCategorySearch.php @@ -52,8 +52,9 @@ class ShopCategorySearch extends ShopCategory 'width' => '2%', 'align' => 'center' ], - 'id', - 'name', + 'id', + 'name', + 'sort_order', [ 'class' => 'iron\grid\ActionColumn', 'align' => 'center', @@ -86,7 +87,8 @@ class ShopCategorySearch extends ShopCategory */ public function search($params) { - $query = ShopCategory::find(); + $query = ShopCategory::find() + ->where(['is_delete' => ShopCategory::IS_DELETE_NO]); // add conditions that should always apply here diff --git a/vendor/antgoods/goods/src/models/searchs/SupplierSearch.php b/vendor/antgoods/goods/src/models/searchs/SupplierSearch.php index 916acb7..fd68feb 100644 --- a/vendor/antgoods/goods/src/models/searchs/SupplierSearch.php +++ b/vendor/antgoods/goods/src/models/searchs/SupplierSearch.php @@ -92,7 +92,7 @@ class SupplierSearch extends Supplier */ public function search($params) { - $query = Supplier::find(); + $query = Supplier::find()->where(['is_delete' => Supplier::IS_DELETE_NO]); // add conditions that should always apply here