Commit 63b284bb by 朱继来

自营预售审核和再次调价

parents cf266123 82ea1b07
......@@ -397,8 +397,8 @@ Class AddOrderController extends Controller
// 确认订单信息
public function confirm(Request $request)
{
if ($request->isMethod('post')) {
$is_online = $request->input('is_online');
if ($request->isMethod('post')) {
$is_online = $request->input('is_online');
$data['uid'] = $request->input('uid', 0);
$data['address_id'] = $request->input('address_id', 0);
$data['cart_id'] = $request->input('cart_ids', '');
......
......@@ -1110,8 +1110,7 @@ Class OrderController extends Controller
$check['k2'] = md5(md5($check['k1']).'fh6y5t4rr351d2c3bryi');
$client_source = $request->input('client_source') == 1 ? $request->input('input-other-source') : $request->input('client_source');
echo '<pre>';
print_r($request->input());die;
$resData = [
"user_id" => $request->input('user_id', ''),
"cancel_reason" => $request->input('cancel_reason', ''),
......@@ -1249,36 +1248,30 @@ print_r($request->input());die;
errorLog(Error::E_FORBIDDEN, '该订单无法再进行调价操作');
return redirect('/prompt')->with(['message'=>"该订单无法再进行调价操作",'url' =>'/details/'.$id, 'jumpTime'=>3,'status'=>false]);
}
$url = Config('website.api_domain').'order/applyAdjust';
$data['confirm_time'] = 0;
$data['pay_time'] = 0;
$data['status'] = 1;
// $data['sale_id'] = 0; // 再次调价调整sale_id
$check['k1'] = time();
$check['k2'] = md5(md5($check['k1']).'fh6y5t4rr351d2c3bryi');
$update = DB::connection('order')->table('lie_order')->where('order_id', $id)->update($data);
$resData = array("order_id"=>$id, "pf"=>1, "k1"=>$check['k1'], "k2"=>$check['k2'], "operator_id" => $request->user->userId);
if (!$update) {
errorLog(Error::E_UPDATE_FAILED, '调价操作更新数据失败');
return redirect('/prompt')->with(['message'=>"调价操作更新数据失败!",'url' =>'/details/'.$id, 'jumpTime'=>3,'status'=>false]);
}
$temp = json_decode(curlApi($url, $resData, "POST"), true);
$extend = DB::connection('order')->table('lie_order_extend')->where(['order_id' => $id])->first();
if ($extend) {
// 调价失败临时表状态更改
DB::connection('order')->table('lie_order_extend')->where(['order_id' => $id])->update(['status' => 0]);
}
// url 标签
$tags = $request->input('tags', '');
// 操作记录
$log['order_id'] = $id;
$log['operator_id'] = $request->user->userId;
$log['operator_type'] = 2;
$log['event'] = '再次调价';
$log['ip'] = get_client_ip();
$log['create_time'] = time();
DB::connection('order')->table('lie_order_action_log')->insert($log);
if ($tags) {
$param = '?tags='.$tags;
} else {
$param = '';
}
return redirect('/change/'.$id);
if ($temp['err_code'] == 0) {
return redirect('/change/'.$id.$param);
} else {
return redirect('/prompt')->with(['message'=>$temp['err_msg'],'url' =>'/details/'.$id.$param, 'jumpTime'=>3,'status'=>false]);
}
}
// 填写订单取消原因
......
......@@ -117,11 +117,11 @@
<!-- 销售类型为预售时展示 -->
@if ($order_info['sale_type'] == 2)
<td>
<input type="text" class="only_number" name="delivery_time" value="" placeholder="请填写天数">
<input type="text" class="only_number" name="change_info[{{$v['rec_id']}}][delivery_time]" value="" placeholder="请填写天数">
</td>
<td>
<label>
<input type="checkbox" name="is_lock[]" value="{{$v['goods_id']}}">
<input type="checkbox" name="change_info[{{$v['rec_id']}}][is_lock]" value="{{$v['goods_id']}}">
<span>锁定库存,可用库存:<b class="text-danger">{{ App\Http\Controllers\getSelfStock($v['goods_id']) }}</b></span>
</label>
......@@ -134,8 +134,8 @@
<?php $extend_fee_items = json_decode($order_temp_info['extend_fee_items'], true); ?>
<!-- 供应商附加费存在且销售类型为现卖,则展示下面 -->
@if ($extend_fee_items && $order_info['sale_type'] == 1)
<!-- 供应商附加费 -->
@if ($extend_fee_items)
<hr/>
<p>附加费设置</p>
<table class="table table-bordered table-hover extend-fee-table">
......@@ -282,8 +282,16 @@
@endif
</p>
<?php
if ($order_info['order_goods_type'] == 2) {
$adjustPriceUrl = "/adjustPrice/".$order_info['order_id']."?tags=self";
} else {
$adjustPriceUrl = "/adjustPrice/".$order_info['order_id'];
}
?>
@if ($order_info['adjust_count'] < 2)
<a class="btn btn-default" href="{{URL('adjustPrice', ['order_id'=>$order_info['order_id']])}}">再次调价</a><span class="warn-tip">每笔订单仅有一次“再次调价”机会</span>
<a class="btn btn-default" href="{{$adjustPriceUrl}}">再次调价</a><span class="warn-tip">每笔订单仅有一次“再次调价”机会</span>
@endif
</div>
......
......@@ -256,6 +256,10 @@
<div class="btn-group btn-group-xs">
<a class="btn btn-primary" href="/details/{{$v['order_id']}}?tags=self" target="_blank">详情</a>
@if (in_array('self_check_order', $userPerms) && in_array($v['status'], [1, 2, 3]) && $v['sale_type'] == 2)
<a class="btn btn-success" href="/change/{{$v['order_id']}}?tags=self" target="_blank">人工审单</a>
@endif
@if (in_array('self_order_download_contract', $userPerms))
<a class="btn btn-default download-contract" data-id="{{$v['order_id']}}" href="javascript:;">下载合同</a>
@endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment