Commit bb535407 by 朱继来

1. 添加付款时间限制

2. 检查付款时间
parent 6ed37108
...@@ -573,6 +573,8 @@ Class OrderController extends Controller ...@@ -573,6 +573,8 @@ Class OrderController extends Controller
"order_amount" => $request->input('order_amount', ''), "order_amount" => $request->input('order_amount', ''),
"extra_fee" => $request->input('extra_fee', ''), "extra_fee" => $request->input('extra_fee', ''),
"change_info" => $request->input('change_info', ''), "change_info" => $request->input('change_info', ''),
"payTime" => $request->input('payTime', ''),
"payTimeOther" => $request->input('payTimeOther', ''),
"order_id" => $order_id, "order_id" => $order_id,
"pf" => 1, "pf" => 1,
"k1" => $check['k1'], "k1" => $check['k1'],
...@@ -1029,5 +1031,66 @@ Class OrderController extends Controller ...@@ -1029,5 +1031,66 @@ Class OrderController extends Controller
return $response; return $response;
} }
// 测试帐号
public function testMobile()
{
$testId = array();
$user = DB::connection('order')->table('lie_user_main')->select('user_id')->where(['is_test' => 1])->get();
foreach ($user as $k => $v) {
$testId[$k] = $v->user_id;
}
return $testId;
}
// 检查订单付款时间 (状态)
public function checkOrderPay()
{
$order = DB::connection('order')
->table('lie_order')
->whereIn('status', ['2', '3'])
->whereNotIn('user_id', $this->testMobile())
->where('is_type', '=', 0)
->select('order_id', 'order_sn', 'user_id', 'order_amount', 'currency', 'pay_time')
->orderBy('create_time', 'DESC')
->get();
//调用消息接口
$url = Config('website.api_domain').'msg/sendmessagebyauto';
$data['k1'] = time();
$data['k2'] = md5(md5($data['k1']).'fh6y5t4rr351d2c3bryi');
$keyword = 'order-pay-time-remind';
if (!empty($order)) {
foreach ($order as $v) {
$diff = $v->pay_time - time();
// 提前一天推送消息
if ($diff <= 86400) {
$currency = $v->currency == 1 ? '¥' : '$';
$orderData = [
"keyword" => $keyword,
"pf" => 1,
"k1" => $data['k1'],
"k2" => $data['k2'],
'touser' => json_encode($v->user_id),
'data' => json_encode([$v->order_sn, $currency.$v->order_amount]),
];
$temp = json_decode(curlApi($url, $orderData, "POST"), true);
if ($temp['err_code'] == 0) {
continue;
}
}
}
}
}
} }
\ No newline at end of file
...@@ -60,3 +60,8 @@ Route::group(['middleware' => 'web'], function () { ...@@ -60,3 +60,8 @@ Route::group(['middleware' => 'web'], function () {
}); });
// 不需要登陆态
Route::group(['middleware' => 'api'], function () {
Route::get ('/api/check/paytime', 'OrderController@checkOrderPay');
});
...@@ -266,4 +266,13 @@ input[type="color"], ...@@ -266,4 +266,13 @@ input[type="color"],
white-space:nowrap; white-space:nowrap;
text-overflow:ellipsis; text-overflow:ellipsis;
margin-bottom: 0; margin-bottom: 0;
}
#payTime {
float: left;
margin-right: 20px;
}
.customArea {
float: left;
display: none;
} }
\ No newline at end of file
...@@ -1130,11 +1130,24 @@ ...@@ -1130,11 +1130,24 @@
} }
}) })
// 选择付款时间
$('#payTime').change(function(){
var val = $(this).val();
if (val == 0) {
$('.customArea').show();
} else {
$('.customArea').hide();
}
})
// 提交表单 // 提交表单
$('.checkOrder').click(function(){ $('.checkOrder').click(function(){
var sale_id = $('input[name=sale_id]:checked').val(); var sale_id = $('input[name=sale_id]:checked').val();
var order_status = $('input[name=order_status]:checked').val(); var order_status = $('input[name=order_status]:checked').val();
var reason = $('input[name=reason]:checked').val(); var reason = $('input[name=reason]:checked').val();
var payTime = $('#payTime').val();
var payTimeOther = $('#payTimeOther').val();
if (sale_id == null) { if (sale_id == null) {
layer.msg('请选择业务员!'); layer.msg('请选择业务员!');
...@@ -1187,6 +1200,16 @@ ...@@ -1187,6 +1200,16 @@
return false; return false;
} }
if (payTime == '') {
layer.msg('请选择付款时间');
return false;
}
if (payTime == 0 && payTimeOther == '') {
layer.msg('请填写自定义时间');
return false;
}
var currencySign = currency == 1 ? '¥' : '$'; var currencySign = currency == 1 ? '¥' : '$';
var goods_amount = currencySign+$('input[name=goods_amount]').val(); var goods_amount = currencySign+$('input[name=goods_amount]').val();
var order_amount = currencySign+$('input[name=order_amount]').val(); var order_amount = currencySign+$('input[name=order_amount]').val();
......
...@@ -73,6 +73,7 @@ ...@@ -73,6 +73,7 @@
</tr> </tr>
</table> </table>
<hr/>
<!-- 调价 --> <!-- 调价 -->
<p>调价</p> <p>调价</p>
<table class="table table-bordered table-hover order-change-table change-table"> <table class="table table-bordered table-hover order-change-table change-table">
...@@ -126,6 +127,7 @@ ...@@ -126,6 +127,7 @@
</table> </table>
<div class="show-advance-pay"> <div class="show-advance-pay">
<hr/>
<p>定金调整</p> <p>定金调整</p>
<table class="table table-bordered table-hover change-table"> <table class="table table-bordered table-hover change-table">
<tr> <tr>
...@@ -147,6 +149,27 @@ ...@@ -147,6 +149,27 @@
</table> </table>
</div> </div>
<p>付款时间</p>
<table class="table table-bordered table-hover change-table">
<tr>
<th>选择付款时间</th>
<td>
<select name="payTime" id="payTime">
<option value="">请选择</option>
<option value="1">1天</option>
<option value="3">3天</option>
<option value="7">7天</option>
<option value="15">15天</option>
<option value="0">其他</option>
</select>
<div class="customArea">
<input type="text" name="payTimeOther" id="payTimeOther" value="" style="width: 50px;">&nbsp;<span class="error">(自定义天数,限制1~30)</span>
</div>
</td>
</tr>
</table>
<a class="btn btn-primary checkOrder">提交</a> <a class="btn btn-primary checkOrder">提交</a>
</form> </form>
@endif @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