|
@@ -2,6 +2,7 @@
|
|
|
|
|
|
namespace app\api\controller;
|
|
namespace app\api\controller;
|
|
|
|
|
|
|
|
+use app\common\Enum\OrderEnum;
|
|
use app\common\model\Order;
|
|
use app\common\model\Order;
|
|
use think\Config;
|
|
use think\Config;
|
|
use app\common\Enum\UserEnum;
|
|
use app\common\Enum\UserEnum;
|
|
@@ -36,9 +37,9 @@ class User extends Base
|
|
|
|
|
|
$info = $this->auth->getUserInfo();
|
|
$info = $this->auth->getUserInfo();
|
|
$info['order'] = [
|
|
$info['order'] = [
|
|
- 'created' => Order::where('user_id', $this->auth->id)->where('orderstate', 0)->where('paystate', 0)->count(),
|
|
|
|
- 'paid' => Order::where('user_id', $this->auth->id)->where('orderstate', 0)->where('paystate', 1)->where('shippingstate', 0)->count(),
|
|
|
|
- 'evaluate' => Order::where('user_id', $this->auth->id)->where('orderstate', 0)->where('paystate', 1)->where('shippingstate', 2)->count()
|
|
|
|
|
|
+ 'created' => Order::where('user_id', $this->auth->id)->where('status',OrderEnum::STATUS_CREATE)->count(),
|
|
|
|
+ 'paid' => Order::where('user_id', $this->auth->id)->where('status',OrderEnum::STATUS_PAY)->count(),
|
|
|
|
+ 'evaluate' => Order::where('user_id', $this->auth->id)->where('status',OrderEnum::STATUS_CONFIRM)->count()
|
|
];
|
|
];
|
|
$info['avatar'] = cdnurl($info['avatar'], true);
|
|
$info['avatar'] = cdnurl($info['avatar'], true);
|
|
$info['gender_text'] = UserEnum::getGenderText($this->auth->getUser()->gender ?? 0);
|
|
$info['gender_text'] = UserEnum::getGenderText($this->auth->getUser()->gender ?? 0);
|