Commit 64df2161 by 朱继来

添加再次调价

parent 926bfbca
......@@ -764,6 +764,32 @@ Class OrderController extends Controller
}
}
// 人工审单后再次调价 --- 20180404
public function adjustPrice(Request $request, $id)
{
$info = $this->orderDetail($request, $id);
//总共允许2次调价(以点击审核按钮次数来统计)
if ($info['order_info']['adjust_count'] >= 2) {
return redirect('/prompt')->with(['message'=>"该订单无法再进行调价操作",'url' =>'/details/'.$id, 'jumpTime'=>3,'status'=>false]);
}
$data['confirm_time'] = 0;
$data['status'] = 1;
$data['sale_id'] = 0; // 再次调价调整sale_id
$update = DB::connection('order')
->table('lie_order')
->where('order_id', '=', $id)
->update($data);
if ($update) {
return redirect('/change/'.$id);
} else {
return redirect('/prompt')->with(['message'=>"调价操作更新数据失败!",'url' =>'/details/'.$id, 'jumpTime'=>3,'status'=>false]);
}
}
// 申请再次调价
public function applyAdjust(Request $request, $id)
{
......
......@@ -44,6 +44,7 @@ Route::group(['middleware' => 'web'], function () {
Route::match(['get', 'post'], '/applyAdjust/{id}', 'OrderController@applyAdjust');
Route::match(['get', 'post'], '/send/{id}', 'OrderController@send');
Route::post('/ajaxCheck', 'OrderController@ajaxCheck');
Route::match(['get', 'post'], '/adjustPrice/{id}', 'OrderController@adjustPrice');
Route::match(['get', 'post'], '/cancelPay/{id}', 'OrderController@cancelPay');
Route::match(['get', 'post'], '/checkPay/{id}', 'OrderController@checkPay');
Route::match(['get', 'post'], '/invShipping/{id}', 'OrderController@invShipping');
......
......@@ -153,6 +153,10 @@
@if ($order_info['status'] == 2)
<p>交易状态:&nbsp;审核通过,请联系客户及时付款!</p>
@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>
@endif
@endif
@if ($order_info['status'] == -1)
......
......@@ -409,11 +409,6 @@
@include('detail.invShipping')
@endif
<if condition="ACTION_NAME eq 'cancel'">
<!--取消订单-->
<include file="cancel"/>
</if>
@if ($action_name == 'cancelPay')
<!--取消订单 (支付前)-->
@include('detail.cancelPay')
......@@ -429,16 +424,6 @@
@include('detail.check')
@endif
<if condition="ACTION_NAME eq 'account'">
<!--账期设置-->
<include file="account"/>
</if>
<if condition="ACTION_NAME eq 'recovery'">
<!--账期设置-->
<include file="recovery"/>
</if>
<!-- 查看ERP订单详情时去掉操作按钮 -->
@if (!isset($_REQUEST['tags']))
<!-- 人工审单时去掉操作按钮 -->
......@@ -449,9 +434,9 @@
@if (($role == 1 || $role ==2) && $order_info['status'] == 1 && in_array('check_order', $userPerms))
<a class="btn btn-success" href="{{URL('change', ['order_id'=>$order_info['order_id']])}}" class="btn btn-default">人工审单</a>
@endif
<!-- <a href="{:U('account', 'order_id='.$order_info['order_id'])}" class="btn btn-default">账期设置</a> -->
@if (($role == 1 || $role ==2) && in_array($order_info['status'], array(1, 2)) && in_array('check_order', $userPerms))
<!-- <a href="{{URL('check', ['order_id'=>$order_info['order_id']])}}" class="btn btn-default">审单</a> -->
@if (($role == 1 || $role ==2) && $order_info['status'] == 2 && in_array('adjust_price', $userPerms))
<!-- <a href="{{URL('adjustPrice', ['order_id'=>$order_info['order_id']])}}" class="btn btn-default">调价</a> -->
@endif
@if ($order_info['status'] == 2 && in_array('cancel_order', $userPerms))
......
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