状态更改

lszyh
zengyyh 4 months ago
parent b3a788315e
commit 1d97d0a0db
  1. 1
      app/api/controller/Retail.php
  2. 8
      app/api/controller/User.php
  3. 5
      app/api/model/RetailOrder.php
  4. 16
      app/api/service/Retail/Payment.php
  5. 4
      app/common/model/Retail.php
  6. 7
      app/store/controller/Retail.php
  7. 7
      app/store/model/Retail.php

@ -17,6 +17,7 @@ use app\api\model\RetailOrder as RetailOrderModel;
use app\api\model\Agreement as AgreementModel;
use app\common\model\RetailDescribe as RetailDescribeModel;
use app\api\service\order\Checkout as CheckoutService;
use app\api\service\User as UserService;
class Retail extends Controller
{

@ -19,6 +19,7 @@ use app\api\model\User as UserModel;
use app\api\model\user\BalanceLog;
use app\api\model\user\GoodSource as GoodsSourceModel;
use app\api\model\user\InvoiceOrder;
use app\api\model\RetailOrder as RetailOrderModel;
use app\api\model\user\UserCoupon;
use app\api\model\user\UserInvoice;
use app\api\model\UserCoupon as UserCouponModel;
@ -51,6 +52,7 @@ class User extends Controller
{
$user_id = UserService::getCurrentLoginUserId();
UserModel::where('user_id', $user_id)->update(['is_delete' => 1, 'update_time' => time()]);
return $this->renderSuccess('注销成功');
}
/**
@ -80,6 +82,12 @@ class User extends Controller
$userInfo['withdrawal_money'] = !empty($dealer_info->money) ? $dealer_info->money : 0;
$userInfo['freeze_money'] = !empty($dealer_info->freeze_money) ? $dealer_info->freeze_money : 0;
}
$retailOrderList = RetailOrderModel::getRetailOrder($userInfo['user_id']);
if(!empty($retailOrderList)){
$userInfo['retail'] = 1;
}else{
$userInfo['retail'] = 0;
}
return $this->renderSuccess(compact('userInfo'));
}

@ -15,6 +15,9 @@ use app\common\model\RetailOrder as RetailOrderModel;
class RetailOrder extends RetailOrderModel
{
public static function getRetailOrder($order_id)
{
return self::where('order_id', $order_id)->where('pay_status',20)->select();
}
}

@ -100,11 +100,11 @@ class Payment extends BaseService
// 构建第三方支付请求的参数
$payment = $this->unifiedorder($extra);
// 记录第三方交易信息
$order_type = OrderTypeEnum::MEMBER;//开通会员
if ($this->orderInfo['order_type'] == IdentityEnum::DEALER) {
$order_type = OrderTypeEnum::DEALER;//开通分销商
}
$this->recordPaymentTrade($payment, $order_type);
// $order_type = OrderTypeEnum::MEMBER;//开通会员
// if ($this->orderInfo['order_type'] == IdentityEnum::DEALER) {
// $order_type = OrderTypeEnum::DEALER;//开通分销商
// }
// $this->recordPaymentTrade($payment, $order_type);
// 返回结果
return compact('payment');
}
@ -167,9 +167,9 @@ class Payment extends BaseService
if (UserService::isStore()) {
throwError('非法操作');
}
if (UserService::isDealerMember() && $info['type'] != IdentityEnum::DEALER) {
throwError('非法操作');
}
// if (UserService::isDealerMember() && $info['type'] != IdentityEnum::DEALER) {
// throwError('非法操作');
// }
if (!$model->createOrder($info->toArray(), $this->method)) {
throwError($model->getError() ?: '创建订单失败');
}

@ -30,10 +30,6 @@ class Retail extends BaseModel
// 更新时间字段
protected $updateTime = 'update_time';
public function getList(array $where)
{
return $this->where($where)->order('sort', 'asc')->select();
}
/**
* @notes:详情

@ -27,13 +27,14 @@ class Retail extends Controller
public function list(): Json
{
$where = [];
$type = $this->request->post('retailType');
$type = $this->request->get('retailType');
$pageSize = intval($this->request->get('pageSize'));
if ($type) {
$where['retail_type'] = $type;
}
// $model = new RetailModel();
$model = new RetailModel();
// $list = $model->getList($where);
$list = RetailModel::withoutGlobalScope()->where($where)->select();
$list = $model->getList($where,$pageSize);
return $this->renderSuccess(compact('list'));
}

@ -17,9 +17,10 @@ use app\common\model\Retail as RetailModel;
class Retail extends RetailModel
{
public function getList(array $where)
{
return $this->where($where)->order('sort', 'asc')->select();
public function getList(array $where ,int $pageSize ): \think\Paginator
{
return $this->where($where)->order('sort', 'asc')
->paginate($pageSize);
}
/**

Loading…
Cancel
Save