作者 何书鹏

代码优化

... ... @@ -601,7 +601,6 @@ class Order extends Api
$model = new \app\api\model\Order();
$order = $model::get($order_id);
if (!$order) $this->error('订单不存在');
// $third = Third::get(['user_id'=>$this->auth->id]);
$third = Third::alias('a')
->join('user b','b.id = a.user_id')
->where('a.user_id',$order['user_id'])
... ... @@ -629,16 +628,14 @@ class Order extends Api
'type' => 'wechat',
'orderid' => $order['order_no'],
'title' => '订单号-'.$order['order_no'],
// 'amount' => $order['pay_price'],
'amount' => 0.01,
'amount' => $order['pay_price'],
// 'amount' => 0.01,
'method' => 'miniapp',
'openid' => $openid,
'notifyurl' => $this->request->domain().'/api/notify/orderNotify/type/wechat',
'returnurl' => '',
];
$result = Service::submitOrder($params);
// $order->pay_user_id = $this->auth->id;
// $order->isUpdate()->save();
$this->success('支付信息',$result);
}
... ... @@ -759,10 +756,10 @@ class Order extends Api
$wechat = Pay::wechat($config);
$refund_no = 'LQ-'.time().mt_rand(10000,99999);
$param = [
// 'total_fee' => $order['pay_price'],
// 'refund_fee' => $order['pay_price'],
'total_fee' => 1,
'refund_fee' => 1,
'total_fee' => $order['pay_price'],
'refund_fee' => $order['pay_price'],
// 'total_fee' => 1,
// 'refund_fee' => 1,
'out_trade_no' => $order['order_no'],
'out_refund_no' => $refund_no
];
... ...
... ... @@ -366,7 +366,6 @@ class Rider extends Api
Db::startTrans();
try{
// $money = 0.01;
$order_sn = date('Ymd') . substr(implode(NULL, array_map('ord', str_split(substr(uniqid(), 7, 13), 1))), 0, 8);
$withdraw = Withdraw::create([
'user_id' => $user['id'],
... ...
... ... @@ -6,7 +6,7 @@ use think\queue\Job;
/**
* 发送优惠券自动操作
* 订单自动操作
*/
class OrderAutoOper extends BaseJob
{
... ...