OrderGoods.php 993 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * Author: 芸众商城 www.yunzshop.com
  5. * Date: 2017/4/21
  6. * Time: 下午1:58
  7. */
  8. namespace app\frontend\models;
  9. use app\common\models\comment\CommentConfig;
  10. use app\frontend\models\goods\Sale;
  11. use app\frontend\modules\goods\models\Comment;
  12. /**
  13. * Class OrderGoods
  14. * @package app\frontend\models
  15. * @property GoodsOption goodsOption
  16. * @property Goods belongsToGood
  17. */
  18. class OrderGoods extends \app\common\models\OrderGoods
  19. {
  20. public function scopeDetail($query)
  21. {
  22. return $query->select(['id', 'order_id', 'refund_id','is_refund', 'goods_option_title', 'goods_id', 'goods_price', 'total', 'price', 'title', 'thumb', 'comment_status']);
  23. }
  24. public function sale()
  25. {
  26. return $this->hasOne(Sale::class, 'goods_id', 'goods_id');
  27. }
  28. public static function getMyCommentList($status)
  29. {
  30. $list = self::select()->Where('comment_status', $status)->orderBy('id', 'desc')->get();
  31. return $list;
  32. }
  33. }