Browse Source

后台分类模型修改生成数据键值对方法,增加除去自身参数判断

antshop
linyaostalker 5 years ago
parent
commit
643f379261
  1. 5
      backend/modules/goods/models/ars/Category.php

5
backend/modules/goods/models/ars/Category.php

@ -99,12 +99,13 @@ class Category extends \yii\db\ActiveRecord
}
/**
* @param int $ownId
* @return array
* 数据键值对
*/
public static function modelColumn()
public static function modelColumn($ownId = 0)
{
return $column = self::find()->select(['name'])->where(['is_delete' => self::IS_DELETE_NO])->indexBy('id')->column();
return $column = self::find()->select(['name'])->where(['is_delete' => self::IS_DELETE_NO])->andWhere(['!=', 'id', $ownId])->indexBy('id')->column();
}
public function getIconFile()

Loading…
Cancel
Save