上游cp新增是否过期查询

master
chenzhi 3 years ago
parent 24e4f77a98
commit 31fa1fcfc2

@ -26,7 +26,8 @@ class PartnerController extends ThinkController
public function lists() public function lists()
{ {
$model = M($this->modelName, 'tab_'); $model = M($this->modelName, 'tab_');
$map = []; $now = time();
$map = ["_string" => "1=1 "];
$id = intval(I('id', 0)); $id = intval(I('id', 0));
if (!empty($id)) { if (!empty($id)) {
$map['tab_partner.id'] = $id; $map['tab_partner.id'] = $id;
@ -56,6 +57,14 @@ class PartnerController extends ThinkController
$time_end = strtotime($_REQUEST['timeend'])+ 86399; $time_end = strtotime($_REQUEST['timeend'])+ 86399;
$map["_string"] = "(contract_start_time <= {$time_end} ) OR (contract_end_time <= {$time_end})"; $map["_string"] = "(contract_start_time <= {$time_end} ) OR (contract_end_time <= {$time_end})";
} }
if (!empty(I('contract_type'))) {
if(I('contract_type') == 1){
$map['_string'] .= " AND (contract_end_time = 0 OR contract_end_time > {$now})";
}else{
$map['_string'] .= " AND (contract_end_time <= {$now} AND contract_end_time != 0)";
}
}
if($_REQUEST['original_package_name']) { if($_REQUEST['original_package_name']) {
$game_map['original_package_name'] = ['like',"%{$_REQUEST['original_package_name']}%"]; $game_map['original_package_name'] = ['like',"%{$_REQUEST['original_package_name']}%"];
@ -241,6 +250,14 @@ class PartnerController extends ThinkController
$contract_end_time = $value['contract_end_time'] ? time_format($value['contract_end_time'], 'Y/m/d') : '-'; $contract_end_time = $value['contract_end_time'] ? time_format($value['contract_end_time'], 'Y/m/d') : '-';
} }
$value['contract_time'] = $contract_start_time . '-' . $contract_end_time; $value['contract_time'] = $contract_start_time . '-' . $contract_end_time;
//判断合同是否过期
if($value['contract_end_time'] == 0){
$value['contract_str'] = "未过期";
}elseif($value['contract_end_time']-0+86399 < time()){
$value['contract_str'] = "<span style='color:red;'>已过期</span>";
}else{
$value['contract_str'] = "未过期";
}
$validity_start_time = $value['validity_start_time'] ? time_format($value['validity_start_time'], 'Y/m/d') : '-'; $validity_start_time = $value['validity_start_time'] ? time_format($value['validity_start_time'], 'Y/m/d') : '-';
if($value['validity_start_time']){ if($value['validity_start_time']){
@ -265,7 +282,7 @@ class PartnerController extends ThinkController
} }
} }
// dd($parseData);
if($is_export){ if($is_export){
$this->assign('listData', $parseData); $this->assign('listData', $parseData);
$GetData = $_GET; $GetData = $_GET;

@ -72,6 +72,7 @@
<th>是否有游戏资质</th> <th>是否有游戏资质</th>
<th>是否签署合同</th> <th>是否签署合同</th>
<th>合同期限</th> <th>合同期限</th>
<th>合同是否过期</th>
<th>生效期限</th> <th>生效期限</th>
<th>公司税号</th> <th>公司税号</th>
<th>开票税点</th> <th>开票税点</th>
@ -136,6 +137,7 @@
<td rowspan="{$data.row}">{$data.is_sign_contract|default="--"}</td> <td rowspan="{$data.row}">{$data.is_sign_contract|default="--"}</td>
<td rowspan="{$data.row}">{$data.contract_time}</td> <td rowspan="{$data.row}">{$data.contract_time}</td>
<td rowspan="{$data.row}">{$data.contract_str}</td>
<td rowspan="{$data.row}">{$data.validity_time}</td> <td rowspan="{$data.row}">{$data.validity_time}</td>
<td rowspan="{$data.row}">{$data.company_tax_no|default="--"}</td> <td rowspan="{$data.row}">{$data.company_tax_no|default="--"}</td>
<td rowspan="{$data.row}">{$data.invoice_rate|showPercent}</td> <td rowspan="{$data.row}">{$data.invoice_rate|showPercent}</td>

@ -84,6 +84,13 @@
<span class="add-on"><i class="icon-th"></i></span> <span class="add-on"><i class="icon-th"></i></span>
</div> </div>
</div> </div>
<div class="input-list input-list-game search_label_rehab">
<select id="contract_type" name="contract_type" class="select_gallery" >
<option value="">合同是否过期</option>
<option value="1">未过期</option>
<option value="2">已过期</option>
</select>
</div>
<div class="input-list"> <div class="input-list">
<a class="sch-btn" href="javascript:;" id="search" url="{:U('lists','model='.$model['name'] .'&row='.I('row'),false)}">搜索</a> <a class="sch-btn" href="javascript:;" id="search" url="{:U('lists','model='.$model['name'] .'&row='.I('row'),false)}">搜索</a>
@ -114,6 +121,7 @@
<th colspan="2">游戏分成比例</th> <th colspan="2">游戏分成比例</th>
<th>合同期限</th> <th>合同期限</th>
<th>合同是否过期</th>
<th>结算周期</th> <th>结算周期</th>
<th>户名</th> <th>户名</th>
<th>账号</th> <th>账号</th>
@ -156,6 +164,7 @@
</notempty> </notempty>
<td rowspan="{$data.row}">{$data.contract_time}</td> <td rowspan="{$data.row}">{$data.contract_time}</td>
<td rowspan="{$data.row}">{$data.contract_str}</td>
<td rowspan="{$data.row}">{$data.settlement_type|default="--"}</td> <td rowspan="{$data.row}">{$data.settlement_type|default="--"}</td>
<td rowspan="{$data.row}">{$data.payee_name|default="--"}</td> <td rowspan="{$data.row}">{$data.payee_name|default="--"}</td>
<td rowspan="{$data.row}">{$data.bank_account|default="--"}</td> <td rowspan="{$data.row}">{$data.bank_account|default="--"}</td>

Loading…
Cancel
Save