Merge branch 'dev' into finance-statistics-total

dev
zhaocheng 5 years ago
commit 20bd9ce864
  1. 4
      common/models/CarT.php
  2. 1
      common/models/SysIpT.php
  3. 20
      frontend/controllers/DatabaseController.php
  4. 16
      frontend/controllers/FinanceController.php
  5. 2
      frontend/controllers/InsurerController.php
  6. 35
      frontend/controllers/MarketingStrategyController.php
  7. 44
      frontend/controllers/SystemController.php
  8. 2
      frontend/views/insurer-type/index.php
  9. 4
      frontend/views/insurer/my-list-info.php
  10. 6
      frontend/views/insurer/office-mng-edit.php
  11. 4
      frontend/views/insurer/original-mng-edit.php
  12. 2
      frontend/views/marketing-strategy/index.php
  13. 2
      frontend/views/pay-type/edit.php
  14. 48
      frontend/views/system/edit.php
  15. 68
      frontend/views/system/ip-edit.php
  16. 154
      frontend/views/system/ip.php

@ -175,11 +175,7 @@ class CarT extends \common\models\Base
switch($this->location) {
case 1:
$car=CarT::findOne(['id'=>$this->id]);
if($car->qiyong==2){
$name = 'A库(永不启用)';
}else{
$name = 'A库';
}
break;
case 2:
$carb=CarBT::findOne(['id'=>$this->id]);

@ -57,7 +57,6 @@ class SysIpT extends \common\models\Base
static public function getIpArray(){
$list = self::find()
->where('status = 1')
->orderBy('id ASC')
->all();

@ -647,10 +647,10 @@ class DatabaseController extends BaseController
$order_row->user_id = $user_id;
$order_row->status_id = 1;
$order_row->id_man = $b_info->car->car_man;
$order_row->id_man_number = $b_info->car->id_number;
$order_row->id_man_number = $b_info->car->id_man_number;
$order_row->link_man = $b_info->car->car_man;
$order_row->link_man_phone = $b_info->car->car_man_phone;
$order_row->link_man_number = $b_info->car->id_number;
$order_row->link_man_number = $b_info->car->id_man_number;
if(!$order_row->save()) {
throw new \Exception(print_r($order_row->getErrors(),true));
}
@ -824,7 +824,7 @@ class DatabaseController extends BaseController
$order_row->id_man = $b_info->car->car_man;
$order_row->link_man = $b_info->car->car_man;
$order_row->link_man_phone = $b_info->car->car_man_phone;
$order_row->link_man_number = $b_info->car->id_number;
$order_row->link_man_number = $b_info->car->id_man_number;
$order_row->return_status_id = 0;
$order_row->return_remark = '';
if(!$order_row->save()) {
@ -1214,10 +1214,10 @@ class DatabaseController extends BaseController
$order_row->user_id = $user_id;
$order_row->status_id = 1;
$order_row->id_man = $c_info->car->car_man;
$order_row->id_man_number = $c_info->car->id_number;
$order_row->id_man_number = $c_info->car->id_man_number;
$order_row->link_man = $c_info->car->car_man;
$order_row->link_man_phone = $c_info->car->car_man_phone;
$order_row->link_man_number = $c_info->car->id_number;
$order_row->link_man_number = $c_info->car->id_man_number;
if(!$order_row->save()) {
throw new \Exception(print_r($order_row->getErrors(),true));
}
@ -1388,10 +1388,10 @@ class DatabaseController extends BaseController
$order_row->user_id = $c_info->user_id;
$order_row->status_id = 1;
$order_row->id_man = $c_info->car->car_man;
$order_row->id_man_number = $c_info->car->id_number;
$order_row->id_man_number = $c_info->car->id_man_number;
$order_row->link_man = $c_info->car->car_man;
$order_row->link_man_phone = $c_info->car->car_man_phone;
$order_row->link_man_number = $c_info->car->id_number;
$order_row->link_man_number = $c_info->car->id_man_number;
if(!$order_row->save()) {
throw new \Exception(print_r($order_row->getErrors(),true));
}
@ -1889,10 +1889,10 @@ class DatabaseController extends BaseController
$order_row->user_id = $user_id;
$order_row->status_id = 1;
$order_row->id_man = $d_info->car->car_man;
$order_row->id_man_number = $d_info->car->id_number;
$order_row->id_man_number = $d_info->car->id_man_number;
$order_row->link_man = $d_info->car->car_man;
$order_row->link_man_phone = $d_info->car->car_man_phone;
$order_row->link_man_number = $d_info->car->id_number;
$order_row->link_man_number = $d_info->car->id_man_number;
if(!$order_row->save()) {
throw new \Exception(print_r($order_row->getErrors(),true));
}
@ -2060,7 +2060,7 @@ class DatabaseController extends BaseController
$order_row->user_id = $d_info->user_id;
$order_row->status_id = 1;
$order_row->id_man = $d_info->car->car_man;
$order_row->id_man_number = $d_info->car->id_number;
$order_row->id_man_number = $d_info->car->id_man_number;
$order_row->link_man = $d_info->car->car_man;
$order_row->link_man_phone = $d_info->car->car_man_phone;
$order_row->link_man_number = $d_info->car->id_man_number;

@ -3271,18 +3271,18 @@ class FinanceController extends \frontend\controllers\UserBaseController
for ($i = 7; $i <= $rowCount; $i++) {
$cell = $currentSheet->getCellByColumnAndRow(1, $i);
$insurer_no = $cell->getValue();//$data[$i][1];
$insurer_no = $cell->getFormattedValue();//$data[$i][1];
// var_dump($insurer_no);
$cell = $currentSheet->getCellByColumnAndRow(2, $i);
$policy_man = $cell->getValue();//$data[$i][2];
$policy_man = $cell->getFormattedValue();//$data[$i][2];
$cell = $currentSheet->getCellByColumnAndRow(3, $i);
$total_real = $cell->getValue();//$data[$i][3];
$total_real = $cell->getFormattedValue();//$data[$i][3];
$cell = $currentSheet->getCellByColumnAndRow(4, $i);
$total_rate = $cell->getValue();//$data[$i][4];
$total_rate = $cell->getFormattedValue();//$data[$i][4];
$cell = $currentSheet->getCellByColumnAndRow(5, $i);
$pay_total = $cell->getValue();//$data[$i][5];
$pay_total = $cell->getFormattedValue();//$data[$i][5];
$cell = $currentSheet->getCellByColumnAndRow(6, $i);
$insurer_total = $cell->getValue();//$data[$i][6];
$insurer_total = $cell->getFormattedValue();//$data[$i][6];
$cell = $currentSheet->getCellByColumnAndRow(7, $i);
$insurer_date = $cell->getFormattedValue();
// var_dump($insurer_date);
@ -7618,10 +7618,6 @@ class FinanceController extends \frontend\controllers\UserBaseController
$query->offset($offset)->limit($limit);
$items = $query->all();
$page_info = MyLib::getPageInfo($pagination);
$group_items = GroupT::getTree();
$data = [];
$data['total'] = $total;
$data['rows'] = [];

@ -737,7 +737,7 @@ class InsurerController extends BaseController
$total1_rate = $request->post('total1_rate','0.00');
$total2_rate = $request->post('total2_rate','0.00');
$pay_no = $request->post('pay_no',0);
$company2_id = $request->post('company2_id',0);
$company2_id = $request->post('company_id',0);
if($total1_rate == '') {
$result['msg'] = '请输入商业跟单手续费!';

@ -110,6 +110,31 @@ class MarketingStrategyController extends UserBaseController
return $result;
}
public function actionDelete() {
Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request;
$result = array();
$result['success'] = false;
$result['msg'] = '删除失败';
$id = $request->post('id',0);
if($id == 0)
return $result;
$tichengTypeT = ZhongjiYingxiao::findOne(['id'=>$id]);
if($tichengTypeT) {
$tichengTypeT->is_delete = 1;
$tichengTypeT->save();
}
$result['success'] = true;
$result['msg'] = '删除成功';
return $result;
}
public function actionUsers() {
$request = Yii::$app->request;
$id = $request->get('id');
@ -493,7 +518,7 @@ class MarketingStrategyController extends UserBaseController
}
$items = ZhongjiTiaojian::find()
->where('celuo_id=:celuo_id and type=1',[':celuo_id'=>$yingxiao_item->id])
->andWhere(['<','baofei', $total1_clear])
->andWhere(['<=','baofei', $total1_clear])
->all();
$ids = [];
foreach($items as $item) {
@ -506,6 +531,8 @@ class MarketingStrategyController extends UserBaseController
$tmp_type_id = 2;
if(in_array($tmp_type_id, $car_type_ids)) {
$flag = true;
} else {
$flag = false;
}
}
//保险公司
@ -513,6 +540,8 @@ class MarketingStrategyController extends UserBaseController
$company_ids = explode(',',$item->company_ids);
if(in_array($company2_id, $company_ids)) {
$flag = true;
} else {
$flag = false;
}
}
//车辆使用类型
@ -520,6 +549,8 @@ class MarketingStrategyController extends UserBaseController
$car_use_ids = explode(',',$item->car_use_id);
if(in_array($car_use_id, $car_use_ids)) {
$flag = true;
} else {
$flag = false;
}
}
//新保、续保
@ -530,6 +561,8 @@ class MarketingStrategyController extends UserBaseController
$tmp_type_id = 2;
if(in_array($tmp_type_id, $type_ids)) {
$flag = true;
} else {
$flag = false;
}
}
if($flag) {

@ -19,7 +19,8 @@ class SystemController extends \yii\web\Controller
{
public $my = null;
public $web = null;
private $_STATE = 1;
public $enableCsrfValidation = false;
public $layout = 'blue-main';
public function init()
{
@ -94,21 +95,27 @@ class SystemController extends \yii\web\Controller
* @author liukangle
*
*/
public function actionIp(){
public function actionIp() {
return $this->render('ip');
}
public function actionIpJson(){
Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request;
$name = $request->get('name');
$ips = SysIpT::find();
if($name != ''){
$ips = $ips->andWhere(['like','city_name',$name]);
$ips = SysIpT::find()->orderBy('id ASC');
$total = $ips->count();
$items = $ips->all();
$data = [];
$data['total'] = $total;
$data['rows'] = [];
foreach($items as $item) {
$row = $item->toArray();
$data['rows'][] = $row;
}
$ips = $ips->andWhere('status ='.$this->_STATE);
$data = $ips->orderBy('id ASC')->all();
return $this->render('ip',[
'info' => $data,
'name' => $name,
]);
return $data;
}
/**
@ -119,7 +126,7 @@ class SystemController extends \yii\web\Controller
* @author liukangle
*
*/
public function actionEdit()
public function actionIpEdit()
{
$request = Yii::$app->request;
@ -129,7 +136,7 @@ class SystemController extends \yii\web\Controller
} else {
$info = new SysIpT();
}
return $this->render('edit',[
return $this->render('ip-edit',[
'info' => $info,
]);
}
@ -181,7 +188,7 @@ class SystemController extends \yii\web\Controller
* @author liukangle
*
*/
public function actionDel()
public function actionIpDelete()
{
Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request;
@ -194,11 +201,12 @@ class SystemController extends \yii\web\Controller
$id = $request->post('id');
if($id > 0){
$row = SysIpT::findOne(['id'=>$id]);
$row->status = 0;
$row->save();
if($row) {
$row->delete();
}
$result['success'] = true;
$result['msg'] = '保存成功';
$result['msg'] = '删除成功';
}
return $result;

@ -47,12 +47,14 @@ use \common\libs\MyLib;
<script>
function opFormatter(value, row, index) {
var opStr = [];
if(row.id > 12) {
opStr.push('<a href="javascript:void(0);" onclick="edit(' + row.id + ')">');
opStr.push('<i class="fa fa-edit" title="编辑"></i>');
opStr.push('</a>');
opStr.push('<a href="javascript:void(0);" onclick="del(' + row.id + ')">');
opStr.push('<i class="fa fa-trash" title="删除"></i>');
opStr.push('</a>');
}
return opStr.join(' ');
}

@ -264,7 +264,7 @@ use common\models\PriceT;
html += '</div>';
$('#gifts').html(html);
} else {
parent.layer.msg(obj.msg);
//parent.layer.msg(obj.msg);
}
}, 'json');
$.get('/marketing-strategy/get-gifts?type=2&order_id=<?=$order_info->id?>&fanxian_id=' + fanxian_id, function(obj){
@ -303,7 +303,7 @@ use common\models\PriceT;
html += '</div>';
$('#quans').html(html);
} else {
parent.layer.msg(obj.msg);
//parent.layer.msg(obj.msg);
}
}, 'json');
}

@ -225,7 +225,7 @@ use common\models\PriceT;
<select name="company_id" id="company_id" class="form-control">
<option value="0">---请选择---</option>
<?php
foreach($insurer_company_items as $item) {
foreach($insurer_company2_items as $item) {
echo '<option value="'.$item->id.'"';
if($item->id == $order_info->company_id)
echo ' selected ';
@ -293,7 +293,7 @@ use common\models\PriceT;
$.post('/insurer/office-mng-save',params,function(obj){
parent.layer.msg(obj.msg);
if(obj.success && status_id>2) {
$('.btn-back')
$('.back-btn').click();
}
},'json');
}
@ -312,7 +312,7 @@ use common\models\PriceT;
},function(obj){
parent.layer.msg(obj.msg);
if(obj.success) {
$('#back-btn').click();
$('.back-btn').click();
}
},'json');
});

@ -398,7 +398,7 @@ use common\models\PriceT;
$.post('/insurer/original-mng-save',params,function(obj){
parent.layer.msg(obj.msg);
if(obj.success && status_id>5) {
$('.btn-back')
$('.btn-back').click();
}
},'json');
}
@ -417,7 +417,7 @@ use common\models\PriceT;
},function(obj){
parent.layer.msg(obj.msg);
if(obj.success) {
$('#back-btn').click();
$('.btn-back').click();
}
},'json');
});

@ -71,7 +71,9 @@ use \common\libs\MyLib;
}, function(){
$.post('/marketing-strategy/delete',{id:id},function(data) {
parent.layer.msg(data.msg);
if(data.success) {
refreshList();
}
}, 'json');
}, function(){
//

@ -50,7 +50,7 @@ use \common\libs\MyLib;
parent.refreshList();
layer_close();
} else {
parent.layer.msg(data.msg);
parent.layer.msg(obj.msg);
}
},'json');
}, function(){

@ -1,48 +0,0 @@
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table">
<form id="theFrm">
<input type="hidden" name="id" value="<?=$info->id?>">
<tr>
<td width="100" height="25" class="td_bg">城市</td>
<td height="25" class="td_bg">
<input name="city_name" type="text" id="city_name" value="<?= $info->city_name ?>" style="width:400px;"/>
</td>
</tr>
<tr>
<td width="100" height="25" class="td_bg">IP</td>
<td height="25" class="td_bg">
<input name="ip" type="text" id="ip" value="<?= $info->ip ?>" style="width:400px;"/>
</td>
</tr>
</form>
<tr>
<td height="22" colspan="2" align="center" class="td_bg">
<input id="submit-btn" type=button class="ACT_btn" name=Submit1 value=" 提交 "/>
&nbsp;&nbsp;
<input id="back-btn" type="button" class="ACT_btn" name="Submit2" value=" 返回 ">
</td>
</tr>
</table>
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script>
<script type="text/javascript" language="javascript" src="/js/ajax.js"></script>
<script type="text/javascript" language="javascript" src="/js/func.js"></script>
<script type="text/javascript" language="javascript">
$(function () {
//提交按钮
$("#submit-btn").click(function(){
if(confirm('是否确认提交?')) {
var params = $("#theFrm").serialize();
$.post('/system/ip-save',params,function(obj){
alert(obj.msg);
if(obj.success) {
$('#back-btn').click();
}
},'json');
}
});
//返回按钮
$('#back-btn').click(function(){
window.location.href='/system/ip';
});
})
</script>

@ -0,0 +1,68 @@
<?php
use \common\libs\MyLib;
?>
<?php $this->beginBlock('header_css'); ?>
<link href="/assets/css/plugins/iCheck/custom.css" rel="stylesheet">
<?php $this->endBlock(); ?>
<div class="wrapper wrapper-content animated fadeInRight">
<div class="ibox float-e-margins">
<div class="ibox-content">
<div class="row">
<div class="col-sm-12">
<form role="form" class="form-horizontal data-from" id="theFrm">
<input type="hidden" name="id" value="<?=intval($info->id)?>">
<div class="form-group">
<label class="col-sm-1 control-label">城市</label>
<div class="col-sm-6">
<input type="text" name="city_name" value="<?=$info->city_name?>" class="form-control">
</div>
</div>
<div class="form-group">
<label class="col-sm-1 control-label">IP</label>
<div class="col-sm-6">
<input type="text" name="ip" value="<?=$info->ip?>" class="form-control">
</div>
</div>
<div>
<div class="row">
<div class="col-sm-5 col-sm-offset-5">
<button class="btn btn-primary btn-save" type="button">
<strong><?=$info ? '保 存':'添 加'?></strong>
</button>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<?php $this->beginBlock('footer_js'); ?>
<script type="text/javascript" language="javascript">
$(function () {
//提交按钮
$(".btn-save").click(function(){
parent.layer.confirm('是否确认提交?', {
btn: ['确认','取消'], //按钮
shade: false //不显示遮罩
}, function(){
var params = $("#theFrm").serialize();
$.post('/system/ip-save',params,function(obj){
if(obj.success) {
parent.layer.msg('保存成功');
parent.refreshList();
layer_close();
} else {
parent.layer.msg(obj.msg);
}
},'json');
}, function(){
//
});
});
})
</script>
<?php $this->endBlock('footer_js'); ?>

@ -1,76 +1,98 @@
<?php
use \common\libs\MyLib;
?>
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script>
<script type="text/javascript" language="javascript" src="/js/ajax.js"></script>
<script type="text/javascript" language="javascript" src="/js/func.js"></script>
<script type="text/javascript" language="javascript">
$(function(){
$('#add-btn').click(function(){
edit(0);
});
$("#search-btn").click(function(){
var params = $('#searchForm').serialize();
window.location.href = "/system/ip?" + params;
});
});
//编辑
<?php $this->beginBlock('header_css'); ?>
<link href="/assets/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
<?php $this->endBlock(); ?>
<div class="wrapper wrapper-content animated fadeInRight">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>外网IP管理</h5>
<div class="ibox-tools">
<a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="create(0)">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="$('#listTable').bootstrapTable('refresh');">
<i class="fa fa-refresh"></i> 刷新
</a>
</div>
</div>
<div class="ibox-content">
<div class="row">
<div class="col-md-12">
<table id="listTable">
<thead>
<tr>
<th width="50" data-field="id">ID</th>
<th data-field="city_name">城市</th>
<th data-field="ip">IP</th>
<th data-formatter="opFormatter">操作</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>
</div>
<?php $this->beginBlock('footer_js'); ?>
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script>
<script src="/assets/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
<script>
function opFormatter(value, row, index) {
var opStr = [];
opStr.push('<a href="javascript:void(0);" onclick="edit(' + row.id + ')">');
opStr.push('<i class="fa fa-edit" title="编辑"></i>');
opStr.push('</a>');
opStr.push('<a href="javascript:void(0);" onclick="del(' + row.id + ')">');
opStr.push('<i class="fa fa-trash" title="删除"></i>');
opStr.push('</a>');
return opStr.join(' ');
}
function create() {
title = '新增IP';
layer_show(title, '/system/ip-edit?id=0');
}
function edit(id) {
window.location.href = '/system/edit?id=' + id;
var title = '编辑IP';
layer_show(title, '/system/ip-edit?id=' + id);
}
//删除
function del(id) {
if(confirm('是否确认删除?')) {
$.post('/system/del',{id:id},function(obj){
alert(obj.msg);
if(obj.success) {
window.location.reload();
}
},'json');
parent.layer.confirm('是否确认删除?', {
btn: ['删除','取消'], //按钮
shade: false //不显示遮罩
}, function(){
$.post('/system/ip-delete',{id:id},function(data) {
parent.layer.msg(data.msg);
refreshList();
}, 'json');
}, function(){
//
});
}
function refreshList() {
$('#listTable').bootstrapTable('refresh');
}
</script>
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table">
<form id="searchForm">
<tr>
<td class="td_bg">
名称:<input name="name" type="text" value="<?= $name ?>">
<input type="button" class="act_btn" id="search-btn" name="search-btn" value="搜索">
<input type="button" class="act_btn" id="add-btn" name="add-btn" value="添加">
</td>
</tr>
</form>
</table>
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
<?php
if($info){
?>
<tr>
<td width="10%" align="center" align="center" class="bg_tr" nowrap>序列号</td>
<td width="30%" align="center" align="center" class="bg_tr">城市</td>
<td width="20%" align="center" align="center" class="bg_tr">IP</td>
<td width="40%" align="center" class="bg_tr">操作</td>
</tr>
<?php
foreach($info as $index => $item){
?>
<tr onMouseOver=overColor(this) onMouseOut=outColor(this)>
<td align="center" class="td_bg" nowrap ><?= $index+1 ?></td>
<td align="left" class="td_bg" nowrap ><?= $item->city_name ?></td>
<td align="left" class="td_bg" nowrap ><?= $item->ip ?></td>
<td align="center" class="td_bg" nowrap>
[<a href="javascript:void(0);" onclick="edit(<?= $item->id ?>)">修改</a>]
[<a href="javascript:void(0);" onclick="del(<?= $item->id ?>)">删除</a>]
</td>
</tr>
<?php
function search() {
$('#listTable').bootstrapTable('destroy');
$('#listTable').bootstrapTable({
url: "/system/ip-json",
pagination: false,
sidePagination: 'server',
queryParams: function(params) {
return params;
}
?>
<?php
}else{
?>
<tr>没有查到数据</tr>
<?php
});
}
?>
</table>
$(function() {
search();
});
</script>
<?php $this->endBlock(); ?>

Loading…
Cancel
Save