Wayne 11 months ago
commit b0d47acc2c
  1. 6
      app/api/controller/Dealer.php
  2. 35
      app/api/model/Order.php
  3. 1
      app/api/model/dealer/User.php

@ -61,6 +61,10 @@ class Dealer extends Controller
*/
public function center(): Json
{
$dealer = $this->dealer->toArray();
$dealer['update_time'] = date("Y-m-d", strtotime($dealer['update_time']));
// 获取用户头像
$this->user = UserModel::related($this->user, ['avatar']);
return $this->renderSuccess([
@ -69,7 +73,7 @@ class Dealer extends Controller
// 当前用户信息
'user' => $this->user,
// 分销商用户信息
'dealer' => $this->dealer,
'dealer' => $dealer,
// 推荐人昵称
'refereeName' => DealerUserModel::getRefereeName(),
// 分销设置

@ -253,6 +253,12 @@ class Order extends OrderModel
$filter[] = ['pay_status', '=', PayStatusEnum::PENDING];
$filter[] = ['order_status', '=', OrderStatusEnum::NORMAL];
break;
//待付款
case 'pay':
$filter[] = ['pay_status', '=', PayStatusEnum::PENDING];
$filter[] = ['order_status', '=', OrderStatusEnum::NORMAL];
break;
//待发货
case 'delivery':
$filter = [
['pay_status', '=', PayStatusEnum::SUCCESS],
@ -260,6 +266,16 @@ class Order extends OrderModel
['order_status', 'in', [OrderStatusEnum::NORMAL, OrderStatusEnum::APPLY_CANCEL]]
];
break;
//待收货
case 'receipt':
$filter = [
['pay_status', '=', PayStatusEnum::SUCCESS],
['delivery_status', '=', DeliveryStatusEnum::DELIVERED],
['receipt_status', '=', ReceiptStatusEnum::NOT_RECEIVED],
['order_status', '=', OrderStatusEnum::NORMAL]
];
break;
//待收货
case 'received':
$filter = [
['pay_status', '=', PayStatusEnum::SUCCESS],
@ -268,6 +284,25 @@ class Order extends OrderModel
['order_status', '=', OrderStatusEnum::NORMAL]
];
break;
//已完成
case 'complete':
$filter = [
['order_status', '=', OrderStatusEnum::COMPLETED]
];
break;
//待取消
case 'apply_cancel':
$filter = [
['order_status', '=', OrderStatusEnum::APPLY_CANCEL]
];
break;
//已取消
case 'cancel':
$filter = [
['order_status', '=', OrderStatusEnum::CANCELLED]
];
break;
//已评价
case 'comment':
$filter = [
['is_comment', '=', 0],

@ -32,7 +32,6 @@ class User extends UserModel
'is_delete',
'store_id',
'create_time',
'update_time',
];
/**

Loading…
Cancel
Save