时间转换

This commit is contained in:
liu 2024-06-08 10:30:37 +08:00
parent ac2c11ba45
commit 5eed480215
2 changed files with 11 additions and 1 deletions

View File

@ -44,7 +44,7 @@ class OrderList extends BaseAdminDataLists implements ListsSearchInterface
{ {
$userId=$this->request->userId; $userId=$this->request->userId;
if(!$userId) return []; if(!$userId) return [];
return StoreOrder::with(['store'])->where($this->searchWhere)->where('uid',$userId) $data = StoreOrder::with(['store'])->where($this->searchWhere)->where('uid',$userId)
->limit($this->limitOffset, $this->limitLength) ->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc']) ->order(['id' => 'desc'])
->select() ->select()
@ -55,6 +55,15 @@ class OrderList extends BaseAdminDataLists implements ListsSearchInterface
$item['goods_count']=count(explode(',',$item['cart_id'])); $item['goods_count']=count(explode(',',$item['cart_id']));
}) })
->toArray(); ->toArray();
foreach ($data as &$value){
if($value['refund_reason_time']){
$value['refund_reason_time'] = date('Y-m-d H:i:s',$value['refund_reason_time']);
}
if($value['pay_time']){
$value['pay_time'] = date('Y-m-d H:i:s',$value['pay_time']);
}
}
return $data;
} }

View File

@ -756,6 +756,7 @@ class OrderLogic extends BaseLogic
$order['vip_price'] = number_format($totalVipPrices, 2); $order['vip_price'] = number_format($totalVipPrices, 2);
$order['refund_price'] = number_format($totalPrice, 2); $order['refund_price'] = number_format($totalPrice, 2);
$order['verify_code'] = verificationCode(); $order['verify_code'] = verificationCode();
$order['refund_reason_time'] = time();
$order['create_time'] = time()+1; $order['create_time'] = time()+1;
$order['update_time'] = null; $order['update_time'] = null;
$order['delete_time'] = null; $order['delete_time'] = null;