当前位置: 首页 > news >正文

南京微信网站开发网站seo新闻

南京微信网站开发,网站seo新闻,天马网络 网站建设,后台网站开发文档问题: 当商品设置限购为 1 时,够买数量未超过限购,但是还是提示超出限购数量 修复方法: 修改代码路径: app\common\repositories\store\order\StoreOrderCreateRepository.php 修改代码一: i s p a y s a r r a y u n i q u e ( a r r a y c o l u m n ( is_pays array_un…

问题: 当商品设置限购为 1 时,够买数量未超过限购,但是还是提示超出限购数量

修复方法:

修改代码路径:

app\common\repositories\store\order\StoreOrderCreateRepository.php
修改代码一: i s p a y s = a r r a y u n i q u e ( a r r a y c o l u m n ( is_pays = array_unique(array_column( ispays=arrayunique(arraycolumn(merchantCart[‘list’],‘is_pay’));
if ( count($is_pays) > 1 || $is_pays[0] == 1) throw new ValidateException(‘存在已购买商品请重新添加购物车’);
// 获取每个商品的ID数组
p r o d u c t i d s = a r r a y c o l u m n ( product_ids = array_column( productids=arraycolumn(merchantCart[‘list’],‘product_id’);
n u m d a t a = a r r a y c o l u m n ( num_data = array_column( numdata=arraycolumn(merchantCart[‘list’],‘cart_num’);
i d n u m = [ ] ; / / 获取每个商品 I D 出现的次数及购买数量,作为验证限购数量使用 f o r e a c h ( id_num = []; // 获取每个商品ID出现的次数及购买数量,作为验证限购数量使用 foreach ( idnum=[];//获取每个商品ID出现的次数及购买数量,作为验证限购数量使用foreach(product_ids as $key => $value) {
i d n u m [ id_num[ idnum[value] = isset( i d n u m [ id_num[ idnum[value]) ? i d n u m [ id_num[ idnum[value] + n u m d a t a [ num_data[ numdata[key] : n u m d a t a [ num_data[ numdata[key];
}
c o u n t L i s t = c o u n t ( countList = count( countList=count(merchantCart[‘list’]);
修改后的样子:在这里插入图片描述
修改代码二:

$count = i d n u m [ id_num[ idnum[cart[‘product_id’]];
if (($count) > $cart[‘product’][‘once_max_count’]) {
throw new ValidateException(‘[超出限购总数:’ . c a r t [ ′ p r o d u c t ′ ] [ ′ o n c e m a x c o u n t ′ ] . ′ ] ′ . m b s u b s t r ( cart['product']['once_max_count'] . ']' . mb_substr( cart[product][oncemaxcount].].mbsubstr(cart[‘product’][‘store_name’], 0, 10) . ‘…’);
}
$pay_count = s t o r e O r d e r R e p o s i t o r y − > g e t M a x C o u n t N u m b e r ( storeOrderRepository->getMaxCountNumber( storeOrderRepository>getMaxCountNumber(cart[‘uid’], c a r t [ ′ p r o d u c t i d ′ ] ) ; i f ( ( cart['product_id']); if (( cart[productid]);if((count + $pay_count) > $cart[‘product’][‘once_max_count’]) {
throw new ValidateException(‘[超出限购总数:’ . c a r t [ ′ p r o d u c t ′ ] [ ′ o n c e m a x c o u n t ′ ] . ′ ] ′ . m b s u b s t r ( cart['product']['once_max_count'] . ']' . mb_substr( cart[product][oncemaxcount].].mbsubstr(cart[‘product’][‘store_name’], 0, 10) . ‘…’);
}
修改后的样子:在这里插入图片描述
最后:修改完了需要重启swoole服务

http://www.yayakq.cn/news/57295/

相关文章:

  • 网站开发的工作流程微信软文案例
  • 发卡平台网站建设优秀的网站设计案例
  • 网站后台和前台设计网页报价
  • 工商工事上哪个网站做深圳外贸网站优化
  • 秦皇岛网站群发关键词杭州开发小程序公司
  • html5网站搭建免费手机虚拟机
  • 基于wordpress个人博客网站论文建设银行沈阳分行网站
  • 外贸自助建站dw软件可以做哪些网站
  • 石家网站建设公司排名石家庄本地招聘信息网
  • 网网站开发站制作公司微模板网站建设
  • 青岛网站设计建议i青岛博采网络用php做注册网站的代码
  • 建设网站专业加强网站建设和信息公开
  • wordpress仿站上传到SEO案例网站建设公司
  • 域名网站备案管理系统色一把做最好的看片网站
  • 网站建设引领者做购物网站多少钱
  • 做国内学历公证的网站手机制作视频
  • 自学编程做点网站赚钱金品诚企网站建设
  • 最好建网站系统的软件网站建设推广有没有
  • 如何评估一个网站100m做电影网站
  • 汉中网站建设报价古镇网站建设哪家好
  • 服务周到的做网站网页制作基础教程本社
  • 网站科技感颜色高效网站建设
  • 网站换肤代码做网站主要用什么软件
  • 电子商务网站建设规划论文如何制作网页链接
  • 北京高端it网站建设wordpress theme开发
  • App网站建设 高品质网站建设苏州市著名网站制作
  • wordpress 获取分类id东莞seo优化关键词排名
  • 给网站做认证亚洲最新永久在线观看
  • 珠海科技网站建设卖汽车的网站怎么做的吗
  • 广州网站的建设网站公告建设方案