zoukankan      html  css  js  c++  java
  • 微信公众号 订单 待发货-配送中-已收货 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;
    }
  • 相关阅读:
    在asp.net中显示/隐藏GridView的列
    WPF中的图表设计器 – 2
    Code Project精彩系列
    C#实现台球游戏
    超级简单:DIV布局
    [WF4.0]工作流设计器Rehosting(三)
    android 集成 第三方应用,包。
    抓log方法
    android logcat 打印
    android build.prop学习
  • 原文地址:https://www.cnblogs.com/rsapaper/p/6542270.html
Copyright © 2011-2022 走看看