修改扫码商品获取

This commit is contained in:
luofei 2024-03-20 15:33:47 +08:00
parent e51561a7cb
commit 55968578cf

View File

@ -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]);
}
}