From 4369bea2d449acf20bdc4bb0cec90e536ccb5e15 Mon Sep 17 00:00:00 2001 From: zengyyh Date: Wed, 31 Jul 2024 18:25:03 +0800 Subject: [PATCH] ad --- app/api/controller/Retail.php | 29 +++++++++++++++++++++++++---- app/api/controller/User.php | 6 +++--- app/api/model/RetailOrder.php | 4 ++-- app/store/model/RetailDescribe.php | 7 +++---- 4 files changed, 33 insertions(+), 13 deletions(-) diff --git a/app/api/controller/Retail.php b/app/api/controller/Retail.php index 74227634..1dd50f8a 100644 --- a/app/api/controller/Retail.php +++ b/app/api/controller/Retail.php @@ -62,9 +62,30 @@ class Retail extends Controller if (!$client['client']) { return $this->renderError('客户端不能为空'); } - $model =new \app\api\service\Retail(); + $model =new \app\api\service\Retail(); $list = $model->userCenter($client); - + $list['retail'] = '开通零售商城的10大优势\n + 1-客户直接在商城查看价格,快速比价、下单\n + 2-所有会员、分销数字化管理\n + 3-所有订单,调货记录,物流状态实时查询\n + 4-供应链资源快速对接\n + 5-商品数据快速上架,商城之间数据实时传输\n + 6-商品市场价实时自动更新\n + 7-货款到账时间支持当天或隔天,支付费率低至千分之2.x\n + 8-支持到店自提、同城闪送\n + 9-促进清洗、安装、维修、回收、租赁服务与产品销售一体化\n + 10-促进本地商家联盟数字化平台化发展'; + $list['wholesale'] = '开通批发商城的10大优势\n + 1-采购代发商家实名注册认证,在线直接下单\n + 2-认证商家、服务商数字化管理\n + 3-所有订单,发货记录,物流状态实时查询\n + 4-所有调货记录在线实时查看\n + 5-审单实时做电话、地址校验比对,避免平台单\n + 6-供应链资源快速对接\n + 7-商品数据快速上架,商城之间商品数据实时传输\n + 8-商品市场价实时自动更新\n + 9-货款到账时间支持当天或隔天,支付费率低至千分之2.x\n + 10-供应商、服务商入驻,销售和推广效益提升'; return $this->renderSuccess(compact('list')); } @@ -94,8 +115,8 @@ class Retail extends Controller * 商厂权限 */ public function describe() - { - $list = RetailDescribeModel::withoutGlobalScope()->select(); + { $type = $this->request->get('type')??10; + $list = RetailDescribeModel::withoutGlobalScope()->where(['description_status' =>10,'type' => $type])->select(); return $this->renderSuccess(compact('list')); } diff --git a/app/api/controller/User.php b/app/api/controller/User.php index df62aed0..86a7e70c 100644 --- a/app/api/controller/User.php +++ b/app/api/controller/User.php @@ -83,13 +83,13 @@ class User extends Controller $userInfo['freeze_money'] = !empty($dealer_info->freeze_money) ? $dealer_info->freeze_money : 0; } $retailOrderList = RetailOrderModel::getRetailOrder($userInfo['user_id']); - $userInfo['retail'] = []; + $userInfo['retail'] = 0; if (empty($retailOrderList)) { // 如果零售订单列表为空,设置用户信息中的零售状态为 1 - $userInfo['retail'] = 1; + $userInfo['retail'] = 0; } else { // 如果零售订单列表不为空,设置用户信息中的零售状态为 0 - $userInfo['retail'] = 0; + $userInfo['retail'] = 1; } return $this->renderSuccess(compact('userInfo')); diff --git a/app/api/model/RetailOrder.php b/app/api/model/RetailOrder.php index 81c2c4d7..0701e997 100644 --- a/app/api/model/RetailOrder.php +++ b/app/api/model/RetailOrder.php @@ -15,9 +15,9 @@ use app\common\model\RetailOrder as RetailOrderModel; class RetailOrder extends RetailOrderModel { - public static function getRetailOrder($order_id) + public static function getRetailOrder($user_id) { - return self::where('order_id', $order_id)->where('pay_status',20)->select(); + return self::where('user_id', $user_id)->where('pay_status',20)->select(); } } \ No newline at end of file diff --git a/app/store/model/RetailDescribe.php b/app/store/model/RetailDescribe.php index 3c7b6b44..954bfc46 100644 --- a/app/store/model/RetailDescribe.php +++ b/app/store/model/RetailDescribe.php @@ -23,6 +23,7 @@ class RetailDescribe extends RetDescribeModel $filter = $this->getFilter($param); $list = $this->field('*') ->where($filter) + ->order(['create_time' => 'asc','sort' => 'asc']) ->paginate($param['pageSize'] ?? 15); return $list; } @@ -53,8 +54,7 @@ class RetailDescribe extends RetDescribeModel $params = $this->setQueryDefaultValue($param, [ 'plate_id' => 0, // 类型id 'search' => '', // 查询内容 - 'wholesale' => 0, // 批发商城 - 'retail' => 0, // 零售商城 + 'type' => 0, // 商城类型 'description_status' => 0, // 状态 ]); // 检索查询条件 @@ -64,8 +64,7 @@ class RetailDescribe extends RetDescribeModel // 用户昵称/订单号 !empty($params['search']) && $filter[] = ['feature|function_description', 'like', "%{$params['search']}%"]; // 批发商城类型 - $params['wholesale'] > 0 && $filter[] = ['wholesale', '=', (int)$params['wholesale']]; - $params['retail'] > 0 && $filter[] = ['retail', '=', (int)$params['retail']]; + $params['type'] > 0 && $filter[] = ['type', '=', (int)$params['type']]; // 支付状态 $params['description_status'] > 0 && $filter[] = ['description_status', '=', (int)$params['description_status']]; return $filter;