• 微信公众号 订单 待发货-配送中-已收货 logic


    w

    function logistics_sameorder($logistics)
    {
        $arr = array();
        $tmp_wxout_trade_no = '';
        $w = 0;
        $wi = 0;
        $wonce = 0;
        foreach ($logistics as $one) {
            if ($wonce == 0) {
                $arr[$w]['wxout_trade_no'] = $one->wxout_trade_no;
                $arr[$w]['wtime'] = $one->wtime;
                $arr[$w]['comname'] = $one->comname;
                $arr[$w]['expressno'] = $one->expressno;
                $arr[$w]['receiver'] = $one->receiver;
                $arr[$w]['tel'] = $one->tel;
                $arr[$w]['province'] = $one->province;
                $arr[$w]['city'] = $one->city;
                $arr[$w]['district'] = $one->district;
                $arr[$w]['street'] = $one->street;
                $arr[$w]['goods'] = array();
                $arr[$w]['goods'][$wi]['name'] = $one->name;
                $arr[$w]['goods'][$wi]['gid'] = $one->gid;
                $arr[$w]['goods'][$wi]['img_string'] = $one->img_string;
                $arr[$w]['goods'][$wi]['num'] = $one->num;
                $arr[$w]['goods'][$wi]['price_out'] = $one->price_out;
                $tmp_wxout_trade_no = $arr[$w]['wxout_trade_no'];
                $wonce = 1;
                continue;
            }
            if ($tmp_wxout_trade_no == $one->wxout_trade_no) {
                $wi++;
                $arr[$w]['goods'][$wi]['name'] = $one->name;
                $arr[$w]['goods'][$wi]['gid'] = $one->gid;
                $arr[$w]['goods'][$wi]['img_string'] = $one->img_string;
                $arr[$w]['goods'][$wi]['num'] = $one->num;
                $arr[$w]['goods'][$wi]['price_out'] = $one->price_out;
            } else {
                $w++;
                $wi = 0;
                $arr[$w]['wxout_trade_no'] = $one->wxout_trade_no;
                $arr[$w]['wtime'] = $one->wtime;
                $arr[$w]['comname'] = $one->comname;
                $arr[$w]['expressno'] = $one->expressno;
                $arr[$w]['receiver'] = $one->receiver;
                $arr[$w]['tel'] = $one->tel;
                $arr[$w]['province'] = $one->province;
                $arr[$w]['city'] = $one->city;
                $arr[$w]['district'] = $one->district;
                $arr[$w]['street'] = $one->street;
                $arr[$w]['goods'] = array();
                $arr[$w]['goods'][$wi]['name'] = $one->name;
                $arr[$w]['goods'][$wi]['gid'] = $one->gid;
                $arr[$w]['goods'][$wi]['img_string'] = $one->img_string;
                $arr[$w]['goods'][$wi]['num'] = $one->num;
                $arr[$w]['goods'][$wi]['price_out'] = $one->price_out;
                $tmp_wxout_trade_no = $arr[$w]['wxout_trade_no'];
            }
        }
        return $arr;
    }
    function logistics_sameorder($logistics)
    {
        $arr = array();
        $tmp_wxout_trade_no = '';
        $w = 0;
        $wi = 0;
        foreach ($logistics as $one) {
            if ($w == 0) {
                $arr[$w]['wxout_trade_no'] = $one->wxout_trade_no;
                $arr[$w]['wtime'] = $one->wtime;
                $arr[$w]['comname'] = $one->comname;
                $arr[$w]['expressno'] = $one->expressno;
                $arr[$w]['receiver'] = $one->receiver;
                $arr[$w]['tel'] = $one->tel;
                $arr[$w]['province'] = $one->province;
                $arr[$w]['city'] = $one->city;
                $arr[$w]['district'] = $one->district;
                $arr[$w]['street'] = $one->street;
                $arr[$w]['goods'] = array();
                $arr[$w]['goods'][$wi]['name'] = $one->name;
                $arr[$w]['goods'][$wi]['gid'] = $one->gid;
                $arr[$w]['goods'][$wi]['img_string'] = $one->img_string;
                $arr[$w]['goods'][$wi]['num'] = $one->num;
                $arr[$w]['goods'][$wi]['price_out'] = $one->price_out;
                $tmp_wxout_trade_no = $arr[$w]['wxout_trade_no'];
                continue;
            }
            if ($tmp_wxout_trade_no == $one->wxout_trade_no) {
                $wi++;
                $arr[$w]['goods'][$wi]['name'] = $one->name;
                $arr[$w]['goods'][$wi]['gid'] = $one->gid;
                $arr[$w]['goods'][$wi]['img_string'] = $one->img_string;
                $arr[$w]['goods'][$wi]['num'] = $one->num;
                $arr[$w]['goods'][$wi]['price_out'] = $one->price_out;
            } else {
                $w++;
                $wi = 0;
                $arr[$w]['wxout_trade_no'] = $one->wxout_trade_no;
                $arr[$w]['wtime'] = $one->wtime;
                $arr[$w]['comname'] = $one->comname;
                $arr[$w]['expressno'] = $one->expressno;
                $arr[$w]['receiver'] = $one->receiver;
                $arr[$w]['tel'] = $one->tel;
                $arr[$w]['province'] = $one->province;
                $arr[$w]['city'] = $one->city;
                $arr[$w]['district'] = $one->district;
                $arr[$w]['street'] = $one->street;
                $arr[$w]['goods'] = array();
                $arr[$w]['goods'][$wi]['name'] = $one->name;
                $arr[$w]['goods'][$wi]['gid'] = $one->gid;
                $arr[$w]['goods'][$wi]['img_string'] = $one->img_string;
                $arr[$w]['goods'][$wi]['num'] = $one->num;
                $arr[$w]['goods'][$wi]['price_out'] = $one->price_out;
                $tmp_wxout_trade_no = $arr[$w]['wxout_trade_no'];
            }
        }
        return $arr;
    }
  • 相关阅读:
    2020年目标检测大盘点 | ECCV大盘点(附论文&代码下载)
    Transformer再下一城!low-level多个任务榜首被占领,北大华为等联合提出预训练模型IPT
    opencv------->>>>>>打印点
    生信工具
    生物信息学练习1-综合使用软件-2
    生物信息学练习1-综合使用软件
    操作指南之下载数据
    安装生物信息学软件-HUMAnN2
    多样性指数介绍
    统计学基础知识-欧式距离与其他
  • 原文地址:https://www.cnblogs.com/rsapaper/p/6542270.html
Copyright © 2020-2023  润新知