@ -16,6 +16,9 @@ use yii\behaviors\TimestampBehavior;
*/
class Brand extends \yii\db\ActiveRecord
{
//是否删除is_delete
const IS_DELETE_NO = 0;//未删除
const IS_DELETE_YES = 1;//已删除
/**
* {@inheritdoc}
@ -44,6 +44,9 @@ use yii\behaviors\TimestampBehavior;
class Goods extends \yii\db\ActiveRecord
@ -114,6 +114,7 @@ class BrandSearch extends Brand
* 条件筛选
private function filter($query, $dataProvider){
$query->andFilterWhere(['is_delete' => Brand::IS_DELETE_NO]);
if (!$this->validate()) {
// uncomment the following line if you do not want to return any records when validation fails
// $query->where('0=1');
@ -121,7 +121,7 @@ class CategorySearch extends Category
$query->andFilterWhere(['is_delete' => 0]);
$query->andFilterWhere(['is_delete' => Category::IS_DELETE_NO]);
@ -143,6 +143,7 @@ class GoodsSearch extends Goods
$query->andFilterWhere(['is_delete' => Goods::IS_DELETE_NO]);