Merge pull request 'feat(OrderEnum): 根据订单状态和退款状态更新订单类型' (#60) from dev into rose
Reviewed-on: #60
This commit is contained in:
commit
c1a0b6adec
@ -64,7 +64,11 @@ class StoreOrderLists extends BaseAdminDataLists implements ListsSearchInterface
|
||||
->order(['id' => 'desc'])
|
||||
->select()->each(function ($item) {
|
||||
$item['pay_time'] = $item['pay_time'] > 0 ? date('Y-m-d H:i:s', $item['pay_time']) : '';
|
||||
$item['status_name'] = OrderEnum::getOrderType($item['status']) ?? '';
|
||||
if($item['status']==-1){
|
||||
$item['status_name'] = OrderEnum::refundStatus($item['refund_status']) ?? '';
|
||||
}else{
|
||||
$item['status_name'] = OrderEnum::getOrderType($item['status']) ?? '';
|
||||
}
|
||||
if ($item['uid'] <= 0) {
|
||||
$item['nickname'] = '游客';
|
||||
} else {
|
||||
|
@ -180,10 +180,6 @@ class OrderEnum
|
||||
*/
|
||||
public static function getOrderType($value = true)
|
||||
{
|
||||
if($value==-1){
|
||||
$status = self::refundStatus($value) ?? '';
|
||||
return $status;
|
||||
}
|
||||
$data = [
|
||||
self::RECEIVED_GOODS => '已完成',
|
||||
self::WAIT_EVALUATION => '待评价',
|
||||
|
@ -40,8 +40,11 @@ class StoreOrder extends BaseModel
|
||||
|
||||
public function getStatusNameTextAttr($value, $data)
|
||||
{
|
||||
|
||||
$status = OrderEnum::getOrderType($data['status']) ?? '';
|
||||
if($data['status']==-1){
|
||||
$status = OrderEnum::refundStatus($data['refund_status']) ?? '';
|
||||
}else{
|
||||
$status = OrderEnum::getOrderType($data['status']) ?? '';
|
||||
}
|
||||
return $status;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user