diff --git a/backend/modules/shop/models/ars/Comment.php b/backend/modules/shop/models/ars/Comment.php index 2ebdee0..b968ca4 100755 --- a/backend/modules/shop/models/ars/Comment.php +++ b/backend/modules/shop/models/ars/Comment.php @@ -4,6 +4,7 @@ namespace backend\modules\shop\models\ars; use Yii; use yii\behaviors\TimestampBehavior; +use backend\modules\shop\models\ars\OrderGoods; /** * This is the model class for table "ats_comment". @@ -19,6 +20,13 @@ use yii\behaviors\TimestampBehavior; */ class Comment extends \yii\db\ActiveRecord { + //状态 + const STATUS_VIEW = 1; //显示 + const STATUS_HIDE = 0; //隐藏 + public static $commentStatus = [ + self::STATUS_VIEW => '显示', + self::STATUS_HIDE => '隐藏' + ]; /** * {@inheritdoc} */ @@ -77,4 +85,9 @@ class Comment extends \yii\db\ActiveRecord ], ]; } + + public function getOrderGoods() + { + return $this->hasOne(OrderGoods::class,['id' => 'order_goods_id']); + } }