diff --git a/app/common/dao/store/product/SpuDao.php b/app/common/dao/store/product/SpuDao.php index 31dbdd6..545d79e 100644 --- a/app/common/dao/store/product/SpuDao.php +++ b/app/common/dao/store/product/SpuDao.php @@ -70,6 +70,9 @@ class SpuDao extends BaseDao ->when(isset($where['is_new']) && $where['is_new'] !== '',function($query)use($where){ $query->whereIn('P.is_new',$where['is_new']); }) + ->when(isset($where['is_good']) && $where['is_good'] !== '',function($query)use($where){ + $query->where('P.is_good',$where['is_good']); + }) ->when(isset($where['keyword']) && $where['keyword'] !== '',function($query)use($where){ if (is_numeric($where['keyword'])) { $query->whereLike("S.store_name|S.keyword|S.product_id", "%{$where['keyword']}%"); diff --git a/app/common/repositories/store/order/StoreOrderRepository.php b/app/common/repositories/store/order/StoreOrderRepository.php index 5b2b9f8..3fb8ad7 100644 --- a/app/common/repositories/store/order/StoreOrderRepository.php +++ b/app/common/repositories/store/order/StoreOrderRepository.php @@ -30,7 +30,9 @@ use app\common\repositories\store\StorePrinterRepository; use app\common\repositories\store\StoreSeckillActiveRepository; use app\common\repositories\system\attachment\AttachmentRepository; use app\common\repositories\system\merchant\FinancialRecordRepository; +use app\common\repositories\system\merchant\MerchantCategoryRepository; use app\common\repositories\system\merchant\MerchantRepository; +use app\common\repositories\system\merchant\MerchantTypeRepository; use app\common\repositories\system\serve\ServeDumpRepository; use app\common\repositories\user\UserBillRepository; use app\common\repositories\user\UserBrokerageRepository; @@ -1363,10 +1365,16 @@ class StoreOrderRepository extends BaseRepository 'spread' => function ($query) { $query->field('uid,nickname,avatar'); }, + 'merchant', ] ); if (!$res) throw new ValidateException('数据不存在'); $res['integral'] = (int)$res['integral']; + + $typeList = app(MerchantTypeRepository::class)->getSelect(); + $typeList = array_column($typeList, 'type_name', 'mer_type_id'); + $res['merchant']['type_name'] = $typeList[$res['merchant']['type_id']] ?? ''; + return $res->append(['refund_extension_one', 'refund_extension_two']); } diff --git a/app/controller/admin/order/Order.php b/app/controller/admin/order/Order.php index e505071..801cbc2 100644 --- a/app/controller/admin/order/Order.php +++ b/app/controller/admin/order/Order.php @@ -140,6 +140,9 @@ class Order extends BaseController $data = $this->repository->getOne($id, null); if (!$data) return app('json')->fail('数据不存在'); + + + return app('json')->success($data); } diff --git a/app/controller/admin/store/StoreProduct.php b/app/controller/admin/store/StoreProduct.php index 98d7891..cae1b09 100755 --- a/app/controller/admin/store/StoreProduct.php +++ b/app/controller/admin/store/StoreProduct.php @@ -158,7 +158,7 @@ class StoreProduct extends BaseController */ public function checkParams(validate $validate) { - $data = $this->request->params(['is_hot','is_best','is_benefit','is_new','store_name','content','rank','star', 'base', 'cash_rate', 'commission_rate']); + $data = $this->request->params(['is_hot','is_best','is_benefit','is_new','is_good','store_name','content','rank','star', 'base', 'cash_rate', 'commission_rate']); $validate->check($data); return $data; } diff --git a/app/controller/api/Auth.php b/app/controller/api/Auth.php index b995c0d..e921907 100644 --- a/app/controller/api/Auth.php +++ b/app/controller/api/Auth.php @@ -20,6 +20,7 @@ use app\common\repositories\system\HuitongRepository; use app\common\repositories\system\notice\SystemNoticeConfigRepository; use app\common\repositories\user\UserAssetsLogRepository; use app\common\repositories\user\UserAssetsRepository; +use app\common\repositories\user\UserGroupRepository; use app\common\repositories\user\UserRepository; use app\common\repositories\user\UserSignRepository; use app\common\repositories\wechat\RoutineQrcodeRepository; @@ -155,7 +156,7 @@ class Auth extends BaseController */ public function userInfo() { - $user = $this->request->userInfo()->hidden(['label_id', 'group_id', 'pwd', 'addres', 'card_id', 'last_time', 'last_ip', 'create_time', 'mark', 'status', 'spread_uid', 'spread_time', 'real_name', 'birthday', 'brokerage_price']); + $user = $this->request->userInfo()->hidden(['label_id', 'pwd', 'addres', 'card_id', 'last_time', 'last_ip', 'create_time', 'mark', 'status', 'spread_uid', 'spread_time', 'real_name', 'birthday', 'brokerage_price']); $user->append(['service', 'topService', 'total_collect_product', 'total_collect_store', 'total_coupon', 'total_visit_product', 'total_unread', 'total_recharge', 'lock_integral', 'total_integral']); $data = $user->toArray(); $data['total_consume'] = $user['pay_price']; @@ -178,12 +179,25 @@ class Auth extends BaseController } } + $groupRepository = app(UserGroupRepository::class); + $groupData = $groupRepository->getList([], 1, 10); + + $groupList = array_column($groupData['list']->toArray(), 'group_name', 'group_id'); + $data['group_name'] = $groupList[$data['group_id']] ?? ''; + // 用户资产 $assets = app(UserAssetsRepository::class)->assets($data['uid']); $data['assets'] = $assets; return app('json')->success($data); } + + public function groupList(){ + $groupRepository = app(UserGroupRepository::class); + $data = $groupRepository->getList([], 1, 10); + return app('json')->success($data['list']); + } + /** * notes 兑换配置 * @return mixed diff --git a/app/controller/api/store/product/StoreSpu.php b/app/controller/api/store/product/StoreSpu.php index de1055d..366e427 100644 --- a/app/controller/api/store/product/StoreSpu.php +++ b/app/controller/api/store/product/StoreSpu.php @@ -63,6 +63,10 @@ class StoreSpu extends BaseController ]); $where['is_gift_bag'] = 0; $where['product_type'] = 0; + if($limit == 6){ + $limit = 10; + $where['is_good'] = 1; + } $where['order'] = $where['order'] ?: 'star'; if ($where['is_trader'] != 1) unset($where['is_trader']); $data = $this->repository->getApiSearch($where, $page, $limit, $this->userInfo); diff --git a/public/mer.html b/public/mer.html index 34936e3..595062b 100644 --- a/public/mer.html +++ b/public/mer.html @@ -1 +1 @@ -