|
|
@ -5,6 +5,7 @@ namespace backend\modules\goods\models\ars; |
|
|
|
use Yii; |
|
|
|
use yii\behaviors\TimestampBehavior; |
|
|
|
use backend\modules\file\models\ars\File; |
|
|
|
use backend\modules\goods\logic\goods\GoodsManager; |
|
|
|
|
|
|
|
/** |
|
|
|
* This is the model class for table "atg_category". |
|
|
@ -105,7 +106,14 @@ class Category extends \yii\db\ActiveRecord |
|
|
|
*/ |
|
|
|
public static function modelColumn($ownId = 0) |
|
|
|
{ |
|
|
|
return $column = self::find()->select(['name'])->where(['is_delete' => self::IS_DELETE_NO])->andWhere(['!=', 'id', $ownId])->indexBy('id')->column(); |
|
|
|
$query = self::find()->where(['is_delete' => self::IS_DELETE_NO]); |
|
|
|
if ($ownId) { |
|
|
|
$query->andWhere(['not in', 'id', GoodsManager::subCategoryId($ownId)]); |
|
|
|
} |
|
|
|
$data = $query->asArray()->all(); |
|
|
|
$data = GoodsManager::btree($data); |
|
|
|
$data = GoodsManager::constructDropList($data); |
|
|
|
return $data; |
|
|
|
} |
|
|
|
|
|
|
|
public function getIconFile() |
|
|
|