This commit is contained in:
mkm 2024-06-24 16:30:34 +08:00
commit 6566fcea3d
5 changed files with 36 additions and 8 deletions

View File

@ -82,7 +82,7 @@ class LoginController extends BaseApiController
if ($result === false) {
return $this->fail(LoginLogic::getError());
}
return $this->success('操作成功', [], 1, 1);
return $this->success('操作成功', [], 1, 0);
}
/**

View File

@ -443,12 +443,12 @@ class LoginLogic extends BaseLogic
{
$find=User::where(['mobile' =>$params['mobile']])->find();
if($find){
$auth=UserAuth::where(['user_id'=>$find['id'],'terminal'=>1])->find();
$auth=UserAuth::where(['user_id'=>$find['id']])->find();//别人的
if($auth){
self::$error ='该手机号已绑定';
self::$error ='该手机号已绑定';
return false;
}else{
UserAuth::where(['user_id'=>$find['id'],'terminal'=>1])->update(['user_id'=>$find['id']]);
UserAuth::where(['user_id'=>$userId])->update(['user_id'=>$find['id']]);
}
}
$data=[

View File

@ -46,6 +46,7 @@ class OrderEnum
const CASHIER_FACE_PAY = 17;//现金收银
const PURCHASE_FUNDS = 18;//采购款收银
const PAY_BACK =-1;
/**
@ -183,10 +184,10 @@ class OrderEnum
public static function getOrderType($value = true)
{
$data = [
self::RECEIVED_GOODS => '已收货',
self::RECEIVED_GOODS => '已完成',
self::WAIT_EVALUATION => '待评价',
self::WAIT_DELIVERY => '待发货',
self::WAIT_RECEIVING => '待收货',
self::WAIT_RECEIVING => '待核销',
self::RETURN_SUCCESS => '退货成功',
self::ALREADY_REFUND => '已退款',
self::RECEIVED_BACK => '已退款',

View File

@ -293,11 +293,38 @@ class PayNotifyLogic extends BaseLogic
}
//微信日志 user_order_refund
$capitalFlowDao->userIncome('user_order_refund', 'system_back', $order['id'], $deal_money,'',1);
//处理财务流水退还
self::store_finance_back($orderSn);
self::addStock($order['id']);//微信
// self::afterPay($order,$extra['transaction_id']);
}
/**
* 财务退还金额相关
* @param $orderSn
* @return void
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public static function store_finance_back($orderSn)
{
$data = StoreFinanceFlow::where('order_sn',$orderSn)
->where(['financial_pm'=>1])
->select()->toArray();
foreach ($data as &$value){
unset($value['id']);
$value['financial_record_sn']=(new StoreFinanceFlowLogic)->getSn();
$value['financial_pm']=0;
$value['financial_type']= OrderEnum::PAY_BACK;
$value['create_time']=time();
}
(new StoreFinanceFlow)->saveAll($data);
}
/**
* 现金退款相关
* @param $orderSn

View File

@ -54,8 +54,8 @@ class StoreOrderLists extends BaseAdminDataLists implements ListsSearchInterface
} elseif ($is_sashier == 2) { //小程序订单
$this->searchWhere[] = ['pay_type', 'in', [7, 3, 18,19]];
}
return StoreOrder::where($this->searchWhere)
->field(['id', 'order_id', 'pay_price', 'pay_time', 'pay_type', 'status', 'paid', 'total_num'])
return StoreOrder::where($this->searchWhere)->with(['user'])
->field(['id', 'order_id', 'pay_price', 'pay_time','uid', 'pay_type', 'status', 'paid', 'total_num'])
->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc'])
->select()->each(function ($item) use ($store_id) {