Browse Source

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

antshop
linyaostalker 5 years ago
parent
commit
d03b3528b6
  1. 5
      backend/modules/goods/models/ars/ShopCategory.php

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

@ -107,12 +107,13 @@ class ShopCategory extends \yii\db\ActiveRecord
} }
/** /**
* @param int $ownId
* @return array * @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() public function getIconFile()

Loading…
Cancel
Save