|
|
@ -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; |
|
|
|
} |
|
|
|
|
|
|
|