Authored by whb

Merge branch 'develop' of http://git.dev.yoho.cn/web/yohomarket.git into develop

... ... @@ -110,6 +110,7 @@ class OrderController extends QLib_Actions_Default {
$StockInfo = YHMProduct_Models_Stock_Client::getOneBySku($v['product_skc'],$v['product_sku']);
$v['size']=$StockInfo['size_name'];
$v['shipping_fee'] = $goodsinfo['shipping_fee'];
$list[] = $v;
$v['product_sku'];
}
... ... @@ -156,10 +157,10 @@ class OrderController extends QLib_Actions_Default {
}
$statusList= YHMOrders_Models_Status_Client::getOrderStatus($code);
$refundList = YHMOrders_Models_Refund_Client::getRefundListByOrdercode($code);
// var_dump($refundList);die;
foreach ($statusList as $k => $v) {
$statusArr[$v['order_status']]=$v;
}
$orderAmount = YHMOrders_Models_Amount_Client::getAmountByOrderCode($code);
// $logdata= $this->LogisticsDetail($info['buyer_uid'],$info['order_code']);
$this->_assign('statusList', $statusList);
$this->_assign('data', $data);
... ... @@ -167,6 +168,7 @@ class OrderController extends QLib_Actions_Default {
$this->_assign('info', $info);
$this->_assign('refundList', $refundList);
$this->_assign('statusArr', $statusArr);
$this->_assign('orderAmount', $orderAmount);
}
public function amountAction()
... ...
... ... @@ -58,6 +58,7 @@
尺码:<?= $v['size'] ?><br>
数量:<?= $v['buy_number'] ?><br>
成交价格:<?= $v['sale_price'] ?><br>
运费:<?=$v['shipping_fee']?><br>
</td>
</tr>
</table>
... ... @@ -144,17 +145,33 @@
$str .= '<div style="width:160px;float:left;">卖家已收款</div>';
$paly = (isset($statusArr[600]['create_time'])) ? $statusArr[600]['create_time'] : 0;
$time = "收款时间:" . date("Y-m-d", $paly+7 * 84600);
if(!empty($orderAmount)){
$end .= '<div style="width:160px;float:left;">';
foreach($orderAmount as $amount){
$end .= $amount['amount'].'元已打款至卖家账户';
}
$end .= '</div>';
}
}
if($info['order_status'] >= 900){
$str .= '<div style="width:160px;float:left;">已退款</div>';
$paly = (isset($statusArr[900]['create_time'])) ? $statusArr[900]['create_time'] : 0;
$time = "退款时间:" . date("Y-m-d", $paly);
if(!empty($orderAmount)){
$end .= '<div style="width:260px;float:left;">';
$amount_type = array('1' => '买家账户','2' => '卖家账户');
$amountStr = '';
foreach($orderAmount as $amount){
$amountStr .= ','.$amount['amount'].'元已退款至'.$amount_type[$amount['type']];
}
$end .= substr($amountStr,1);
$end .='</div>';
}
}
echo $str.'<div style="clear:both;"></div>';
?>
</td>
</tr>
<?php if($info['order_status'] >= 300 && $info['order_status'] <= 810 )?>
<tr style="margin-top:10px;">
<td>
<table style="background-color: #E0E0E0; width: 290px;margin-top: 20px;" >
... ... @@ -164,7 +181,6 @@
</table>
</td>
</tr>
<?php ?>
</table>
</td>
<td style=" padding-left: 20px; padding-top: 10px"><?= $time ?></td>
... ...
... ... @@ -46,5 +46,12 @@ class YHMOrders_Models_Amount_Client {
return self::dao()->setAmountStatus($order_code,$status);
}
/**
* 根据订单号获取金额
* @param int $order_code
* @return array
*/
public static function getAmountByOrderCode($order_code){
return self::dao()->getAmountByOrderCode($order_code);
}
}
... ...
... ... @@ -38,4 +38,12 @@ class YHMOrders_Models_Amount_Dao extends YHMOrders_Dao {
$this->dao()->tag($this->_tag . $order_code)->update(Amount\Amount::SET_AMOUNT_STAUS, $params)->status();
}
/**
* 根据订单号获取金额
* @param int $order_code
* @return array
*/
public function getAmountByOrderCode($order_code){
$this->dao()->tag($this->_tag . $order_code)->fetchAssoc(Amount\Amount::GET_AMOUNT_BY_ORDER_CODE,array('order_code' => $order_code));
}
}
... ...
... ... @@ -8,5 +8,5 @@ class Amount {
const SET_AMOUNT = 'insert into `orders_amount`(`order_code`, `amount`,admin_id, `uid`,type,`desc`,`create_time`) values (:order_code,:amount,:admin_id,:uid,:type,:desc,UNIX_TIMESTAMP())';
const SET_AMOUNT_STAUS="update `orders_amount` set status=:status where order_code=:order_code ";
const GET_AMOUNT_BY_ORDER_CODE = ' select `type`,`amount` from orders_amount where order_code = :order_code order by type asc ';
}
... ...