diff --git a/app/controller/api/store/order/ScanPay.php b/app/controller/api/store/order/ScanPay.php index 3950e85b..e7743a6a 100644 --- a/app/controller/api/store/order/ScanPay.php +++ b/app/controller/api/store/order/ScanPay.php @@ -3,6 +3,7 @@ namespace app\controller\api\store\order; use app\common\model\store\product\Product; +use app\common\model\store\product\ProductAttrValue; use app\common\repositories\store\product\ProductRepository; use app\controller\api\Common; use crmeb\basic\BaseController; @@ -41,7 +42,19 @@ class ScanPay extends BaseController $siteUrl = systemConfig('site_url'); $user = $this->request->userInfo(); $data = $common->Qrcode(['code' => $siteUrl . 'pages/payment/get_payment?mer_id=' . $merId, 'id' => $user['uid']]); - return app('json')->success(['url' => $data]); + $where = [ + "a.mer_id" => $merId, + "p.is_show" => 1, + "p.status" => 1, + "p.is_gift_bag" => 0 + ]; + $count = ProductAttrValue::alias('a') + ->leftJoin('store_product p', 'a.product_id = p.product_id') + ->where($where) + ->field('a.value_id,a.product_id,a.mer_id,a.sku,a.stock,a.image,a.price, + a.svip_price, + a.unique,p.store_name,p.store_info')->count(); + return app('json')->success(['url' => $data, 'count' => $count]); } }