Browse Source

admin order

master
林一峰 6 years ago
parent
commit
9447ff6524
  1. 16
      app/Http/Controllers/Admin/OrderController.php
  2. 2
      resources/views/admin/order/index.blade.php
  3. 2
      resources/views/admin/tag/index.blade.php

16
app/Http/Controllers/Admin/OrderController.php

@ -72,7 +72,7 @@ class OrderController extends CommonController
$posts = parent::pageList('order', $where); $posts = parent::pageList('order', $where);
foreach($posts as $key=>$value) foreach($posts as $key=>$value)
{ {
$order_status_arr = Order::getOrderStatusText(object_to_array($value, 1));
$order_status_arr = model('Order')->getOrderStatusAttr($value);
$posts[$key]->order_status_text = $order_status_arr?$order_status_arr['text']:''; $posts[$key]->order_status_text = $order_status_arr?$order_status_arr['text']:'';
$posts[$key]->order_status_num = $order_status_arr?$order_status_arr['num']:''; $posts[$key]->order_status_num = $order_status_arr?$order_status_arr['num']:'';
@ -96,16 +96,16 @@ class OrderController extends CommonController
if($data['post']) if($data['post'])
{ {
$order_status_arr = Order::getOrderStatusText($data['post']);
$order_status_arr = model('Order')->getOrderStatusAttr($data['post']);
$data['post']['order_status_text'] = $order_status_arr?$order_status_arr['text']:''; $data['post']['order_status_text'] = $order_status_arr?$order_status_arr['text']:'';
$data['post']['order_status_num'] = $order_status_arr?$order_status_arr['num']:''; $data['post']['order_status_num'] = $order_status_arr?$order_status_arr['num']:'';
$data['post']['province_name'] = Region::getRegionName($data['post']['province']);
$data['post']['city_name'] = Region::getRegionName($data['post']['city']);
$data['post']['district_name'] = Region::getRegionName($data['post']['district']);
$data['post']['province_name'] = model('Region')->getRegionName(['id'=>$data['post']->province]);
$data['post']['city_name'] = model('Region')->getRegionName(['id'=>$data['post']->city]);
$data['post']['district_name'] = model('Region')->getRegionName(['id'=>$data['post']->district]);
$data['post']['invoice_text'] = Order::getInvoiceText($data['post']);
$data['post']['place_type_text'] = Order::getPlaceTypeText($data['post']);
$data['post']['invoice_text'] = model('Order')->getInvoiceAttr($data['post']);
$data['post']['place_type_text'] = model('Order')->getPlaceTypeAttr($data['post']);
$data['post']['user'] = User::where(array('id'=>$data['post']['user_id']))->first(); //下单人信息 $data['post']['user'] = User::where(array('id'=>$data['post']['user_id']))->first(); //下单人信息
@ -113,7 +113,7 @@ class OrderController extends CommonController
foreach($order_goods as $k=>$v) foreach($order_goods as $k=>$v)
{ {
$order_goods[$k]['refund_status_text'] = OrderGoods::getRefundStatusText($v);
$order_goods[$k]['refund_status_text'] = model('OrderGoods')->getRefundStatusAttr($v);
} }
$data['post']['goodslist'] = $order_goods; $data['post']['goodslist'] = $order_goods;

2
resources/views/admin/order/index.blade.php

@ -59,7 +59,7 @@ function output_excel()
<?php if($posts){foreach($posts as $row){ ?> <?php if($posts){foreach($posts as $row){ ?>
<tr> <tr>
<td><a href="<?php echo route('admin_order_detail',array('id'=>$row->id)); ?>"><?php echo $row->order_sn.'-'.$row->id; ?></a>, 金额:<?php echo $row->order_amount; ?><br>下单时间:<?php echo date('Y-m-d H:i:s',$row->add_time); ?></td> <td><a href="<?php echo route('admin_order_detail',array('id'=>$row->id)); ?>"><?php echo $row->order_sn.'-'.$row->id; ?></a>, 金额:<?php echo $row->order_amount; ?><br>下单时间:<?php echo date('Y-m-d H:i:s',$row->add_time); ?></td>
<td><?php if($row->pay_money){echo '支付金额:'.$row->pay_money;} ?><?php if($row->out_trade_no){echo ', 流水号:'.$row->out_trade_no;} ?><?php if($row->pay_name){echo '<br><font color="green">'.$row->pay_name.'</font>, ';} ?><?php if($row->pay_time){echo '支付时间:'.date('Y-m-d H:i:s',$row->pay_time);} ?></td>
<td><?php if($row->pay_money){echo '支付金额:'.$row->pay_money;} ?><?php if($row->trade_no){echo ', 流水号:'.$row->out_trade_no;} ?><?php if($row->pay_name){echo '<br><font color="green">'.$row->pay_name.'</font>, ';} ?><?php if($row->pay_time){echo '支付时间:'.date('Y-m-d H:i:s',$row->pay_time);} ?></td>
<td><?php echo $row->name.'[TEL:'.$row->mobile.']'; ?><br><?php echo $row->province_name; ?><?php echo $row->city_name; ?><?php echo $row->district_name; ?></td> <td><?php echo $row->name.'[TEL:'.$row->mobile.']'; ?><br><?php echo $row->province_name; ?><?php echo $row->city_name; ?><?php echo $row->district_name; ?></td>
<td><?php if($row->order_status_text=='待发货'){echo '<font color="red">'.$row->order_status_text.'</font>';}else{echo $row->order_status_text;} ?></td> <td><?php if($row->order_status_text=='待发货'){echo '<font color="red">'.$row->order_status_text.'</font>';}else{echo $row->order_status_text;} ?></td>
<td><?php if($row->place_type==1){echo 'pc';}elseif($row->place_type==2){echo 'weixin';}elseif($row->place_type==3){echo 'app';}elseif($row->place_type==4){echo 'wap';} ?></td> <td><?php if($row->place_type==1){echo 'pc';}elseif($row->place_type==2){echo 'weixin';}elseif($row->place_type==3){echo 'app';}elseif($row->place_type==4){echo 'wap';} ?></td>

2
resources/views/admin/tag/index.blade.php

@ -20,7 +20,7 @@
<td><?php echo $row->id; ?></td> <td><?php echo $row->id; ?></td>
<td><a href="/fladmin/tag/edit?id=<?php echo $row->id; ?>"><?php echo $row->tag; ?></a></td><td><?php echo tagarcnum($row->id); ?></td> <td><a href="/fladmin/tag/edit?id=<?php echo $row->id; ?>"><?php echo $row->tag; ?></a></td><td><?php echo tagarcnum($row->id); ?></td>
<td><?php echo date('Y-m-d',$row->pubdate); ?></td> <td><?php echo date('Y-m-d',$row->pubdate); ?></td>
<td><a target="_blank" href="<?php echo get_front_url(array("type"=>"tags","tagid"=>$row->id)); ?>">预览</a>&nbsp;<a href="/fladmin/tag/edit?id=<?php echo $row->id; ?>">修改</a>&nbsp;<a onclick="delconfirm('/fladmin/tag/del?id=<?php echo $row->id; ?>')" href="javascript:;">删除</a></td>
<td><a target="_blank" href="<?php echo route('home_tag', array('tag'=>$row->id)); ?>">预览</a>&nbsp;<a href="/fladmin/tag/edit?id=<?php echo $row->id; ?>">修改</a>&nbsp;<a onclick="delconfirm('/fladmin/tag/del?id=<?php echo $row->id; ?>')" href="javascript:;">删除</a></td>
</tr> </tr>
<?php } ?> <?php } ?>
</tbody> </tbody>

Loading…
Cancel
Save