Browse Source

refactor:修改后台商品分类获取数据键值对方法

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

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

@ -101,10 +101,11 @@ class Category extends \yii\db\ActiveRecord
/**
* @param int $ownId
* @param int $needDefault
* @return array
* 数据键值对
*/
public static function modelColumn($ownId = 0)
public static function modelColumn($ownId = 0, $needDefault = 1)
{
$query = self::find()->where(['is_delete' => self::IS_DELETE_NO]);
if ($ownId) {
@ -112,7 +113,7 @@ class Category extends \yii\db\ActiveRecord
}
$data = $query->asArray()->all();
$data = GoodsManager::btree($data);
$data = GoodsManager::constructDropList($data);
$data = GoodsManager::constructDropList($data, $needDefault);
return $data;
}

Loading…
Cancel
Save