From fe8fe20ba0ed418aeda14809df6a379f34a5477e Mon Sep 17 00:00:00 2001 From: linyaostalker <602604991@qq.com> Date: Tue, 17 Dec 2019 10:22:55 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=AE=9A=E4=B9=89=E8=AF=84=E8=AE=BA?= =?UTF-8?q?=E6=A8=A1=E5=9E=8B=E4=B8=AD=E7=9A=84=E7=8A=B6=E6=80=81=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/modules/shop/models/ars/Comment.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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']); + } }