Browse Source

设置antgoods模块品牌,分类,商品的删除字段以及检索显示是隐藏已删除数据

wechat_public_accounts
linyaostalker 5 years ago
parent
commit
b809932515
  1. 3
      vendor/antgoods/goods/src/models/ars/Brand.php
  2. 3
      vendor/antgoods/goods/src/models/ars/Goods.php
  3. 1
      vendor/antgoods/goods/src/models/searchs/BrandSearch.php
  4. 2
      vendor/antgoods/goods/src/models/searchs/CategorySearch.php
  5. 1
      vendor/antgoods/goods/src/models/searchs/GoodsSearch.php

3
vendor/antgoods/goods/src/models/ars/Brand.php

@ -16,6 +16,9 @@ use yii\behaviors\TimestampBehavior;
*/ */
class Brand extends \yii\db\ActiveRecord class Brand extends \yii\db\ActiveRecord
{ {
//是否删除is_delete
const IS_DELETE_NO = 0;//未删除
const IS_DELETE_YES = 1;//已删除
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */

3
vendor/antgoods/goods/src/models/ars/Goods.php

@ -44,6 +44,9 @@ use yii\behaviors\TimestampBehavior;
*/ */
class Goods extends \yii\db\ActiveRecord class Goods extends \yii\db\ActiveRecord
{ {
//是否删除is_delete
const IS_DELETE_NO = 0;//未删除
const IS_DELETE_YES = 1;//已删除
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */

1
vendor/antgoods/goods/src/models/searchs/BrandSearch.php

@ -114,6 +114,7 @@ class BrandSearch extends Brand
* 条件筛选 * 条件筛选
*/ */
private function filter($query, $dataProvider){ private function filter($query, $dataProvider){
$query->andFilterWhere(['is_delete' => Brand::IS_DELETE_NO]);
if (!$this->validate()) { if (!$this->validate()) {
// uncomment the following line if you do not want to return any records when validation fails // uncomment the following line if you do not want to return any records when validation fails
// $query->where('0=1'); // $query->where('0=1');

2
vendor/antgoods/goods/src/models/searchs/CategorySearch.php

@ -121,7 +121,7 @@ class CategorySearch extends Category
* 条件筛选 * 条件筛选
*/ */
private function filter($query, $dataProvider){ private function filter($query, $dataProvider){
$query->andFilterWhere(['is_delete' => 0]);
$query->andFilterWhere(['is_delete' => Category::IS_DELETE_NO]);
if (!$this->validate()) { if (!$this->validate()) {
// uncomment the following line if you do not want to return any records when validation fails // uncomment the following line if you do not want to return any records when validation fails
// $query->where('0=1'); // $query->where('0=1');

1
vendor/antgoods/goods/src/models/searchs/GoodsSearch.php

@ -143,6 +143,7 @@ class GoodsSearch extends Goods
* 条件筛选 * 条件筛选
*/ */
private function filter($query, $dataProvider){ private function filter($query, $dataProvider){
$query->andFilterWhere(['is_delete' => Goods::IS_DELETE_NO]);
if (!$this->validate()) { if (!$this->validate()) {
// uncomment the following line if you do not want to return any records when validation fails // uncomment the following line if you do not want to return any records when validation fails
// $query->where('0=1'); // $query->where('0=1');

Loading…
Cancel
Save