public function getOrderInfoByIdList($idlist, $where = '') { $str = implode(',', $idlist); $sql = "\n select so.id, so.platformUsername,so.accountId, so.zipCode, so.username, so.countryName, so.countrySn, so.state, so.city, so.street, so.address2, so.address3, so.landline, so.phone\n ,so.createdTime, sor.recordNumber,sor.originOrderId from wh_shipping_order as so join wh_shipping_order_relation as sor on so.id=sor.shipOrderId where 1 and so.id in ({$str}) \n group by so.id {$where}\n "; $orderlist = array(); $q_order = $this->dbconn->query($sql); $orderlist = $this->dbconn->fetch_array_all($q_order); $total = 0; foreach ($orderlist as &$list) { $list['countryZh'] = CommonModel::getCountryNameCn($list['countryName']); $remarks = CommonModel::getExpressRemark($list['id']); //得到快递备注 $accountId = CommonModel::getAccountNameById($list['accountId']); //店铺账号 $list['appname'] = $accountId['account']; //账号昵称 if (!empty($remarks)) { foreach ($remarks as $remark) { $total += $remark['amount'] * $remark['price']; } } $list['remarkTotal'] = $total; $list['remark'] = $remarks; } return $orderlist; }
public function view_getExpressRemark() { $id = isset($_GET['id']) ? $_GET['id'] : ''; if (empty($id)) { return false; } $data = CommonModel::getExpressRemark($id); if (empty($data)) { echo '查询不到数据!'; exit; } $total = 0; foreach ($data as $k => $v) { $total += $v['price'] * $v['amount']; $type = $v['type']; } $this->smarty->assign('data', $data); $this->smarty->assign('total', $total); $this->smarty->assign('type', $type); $this->smarty->display('expressRemark.htm'); }
$text .= '|' . $order['zipCode'] . $lt; $text .= '|' . $order['countryName'] . $lt; /* if(empty($order['ebay_couny'])){ $country_name = $order['countryName']; $c_sql = "select * from ebay_countrys where countryen='{$country_name}'"; $c_sql = $dbcon->execute($c_sql); $country = $dbcon->fetch_one($c_sql); $text .= '|'.$country['countrysn'].$lt; }else{ $text .= '|'.$order['ebay_couny'].$lt; }*/ $text .= '|' . $order['countrySn'] . $lt; $text .= !empty($order['landline']) ? '|' . $order['landline'] . $lt : '|' . $order['phone'] . $lt; $text .= '|' . $order['recordNumber'] . $lt; $order_details = CommonModel::getExpressRemark($order['id']); $count = count($order_details); if (!empty($order_details)) { foreach ($order_details as $key => $order_detail) { $text .= '|' . str_replace('´', '\'', stripslashes($order_detail['description'])) . $lt; $price = $order_detail['price'] * $order_detail['amount']; $all_amount += $order_detail['amount']; //总申数量 $all_price += $price; //总申报价 } } if ($count < 3) { for ($i = 0; $i < 3 - $count; $i++) { $text .= '|' . $lt; }