diff --git a/app/common/dao/store/order/StoreOrderDao.php b/app/common/dao/store/order/StoreOrderDao.php index 92ba6cfb..72718e8e 100644 --- a/app/common/dao/store/order/StoreOrderDao.php +++ b/app/common/dao/store/order/StoreOrderDao.php @@ -99,13 +99,13 @@ class StoreOrderDao extends BaseDao // 12表示信用购 switch ($where['status']) { case 0 : - $query->where('paid', 1)->whereIn('StoreOrder.status', [0, 9]); + $query->where('StoreOrder.paid', 1)->whereIn('StoreOrder.status', [0, 9]); break; case 1 : $query->where('paid', 1)->where('StoreOrder.status', 1); break; case 2 : - $query->where('paid', 1)->where('StoreOrder.status', 2)->where('pay_type', '<>', StoreGroupOrder::PAY_TYPE_CREDIT_BUY); + $query->where('StoreOrder.paid', 1)->where('StoreOrder.status', 2)->where('pay_type', '<>', StoreGroupOrder::PAY_TYPE_CREDIT_BUY); break; case 3 : $query->where('paid', 1)->where('StoreOrder.status', 1); @@ -122,7 +122,7 @@ class StoreOrderDao extends BaseDao $query->where('paid', 1)->whereIn('StoreOrder.status', [2, 3]); break; default: - // $query->where('paid', 1)->where('StoreOrder.status', $where['status']); + $query->where('paid', 1)->where('StoreOrder.status', $where['status']); break; } }) diff --git a/app/common/repositories/store/order/StoreOrderRepository.php b/app/common/repositories/store/order/StoreOrderRepository.php index 7196f20f..7caeeefb 100644 --- a/app/common/repositories/store/order/StoreOrderRepository.php +++ b/app/common/repositories/store/order/StoreOrderRepository.php @@ -876,7 +876,7 @@ class StoreOrderRepository extends BaseRepository case 1: break; // 未支付 case 2: - $param['paid'] = 1; + $param['StoreOrder.paid'] = 1; $param['StoreOrder.status'] = 0; break; // 待发货 case 3: @@ -1601,7 +1601,6 @@ class StoreOrderRepository extends BaseRepository ]); $count = $query->count(); $list = $query->page($page, $limit)->select()->append(['refund_extension_one', 'refund_extension_two']); - return compact('count', 'list'); } diff --git a/app/controller/api/community/Community.php b/app/controller/api/community/Community.php index e81a65e7..db421b60 100644 --- a/app/controller/api/community/Community.php +++ b/app/controller/api/community/Community.php @@ -594,6 +594,13 @@ class Community extends BaseController if ($resaleList) $resaleList = $resaleList->toArray(); foreach($resaleList as $k=>$v) { $resaleList[$k]['detail'] = json_decode($v['detail'], true); + if (empty($v['image'])) { + $prodImage = Db::name('store_product')->where('product_id', $v['product_id'])->value('image'); + $prodImageList = explode(',', $prodImage); + if (count($prodImageList) > 0) { + $resaleList[$k]['image'] = $prodImageList[0]; + } + } } $communityInfo['resale'] = $resaleList; return app('json')->success($communityInfo);