Пример #1
0
 $api->sendIntegral($wxid, $num = 0, $content);
 switch ($content) {
     case "best":
     case "new":
     case "hot":
         $newsData = array();
         $reMsg = $api->getGoods($content);
         if ($reMsg) {
             foreach ($reMsg as $k => $v) {
                 $newsData[$k]['Title'] = $v['name'];
                 $newsData[$k]['Description'] = strip_tags($v['name']);
                 $newsData[$k]['PicUrl'] = strpos($v['thumb'], 'http://') !== false ? $v['thumb'] : $baseurl . $v['thumb'];
                 $newsData[$k]['Url'] = $weburl . "mobile/" . $v['url'];
             }
         }
         echo $weixin->news($newsData)->reply();
         exit;
         break;
     case "ddcx":
         $reMsg = $api->getOrder($wxid);
         if ($reMsg === false) {
             echo $weixin->text("您还没有绑定帐号!")->reply();
             exit;
         } else {
             $os = array(0 => '未确认', 1 => '已确认', 2 => '取消', 3 => '无效', 4 => '退款');
             $ps = array(0 => '未付款', 1 => '部分支付', 2 => '已付款');
             $ss = array(0 => '未发货', 1 => '已发货', 2 => '确认收货', 3 => '配货中', 4 => '已发货(部分商品)');
             foreach ($reMsg as $v) {
                 $text .= "订单编号:<a href='{$weburl}mobile/user.php?act=order_detail" . "%26" . "order_id={$v[order_id]}'>{$v['order_sn']}</a>\r\n";
                 $text .= "订单金额:{$v['order_amount']}\r\n";
                 $text .= "订单状态:{$os[$v['order_status']]}\r\n";