master
yulingwei 5 years ago
parent bbb7cb23f6
commit e6c8b51127

@ -575,7 +575,9 @@ WHERE old_change_promote_id in ({$promoteData})";
if (!empty($_GET['title'])) {
$map['title'] = ['like', "%{$_GET['title']}%"];
}
$list = M('service_agreement', 'tab_')->where($map)->page($p, $row)->select();
$list = M('service_agreement', 'tab_')
->field("tab_service_agreement.*, group_concat(distinct(tab_promote_company.company_name)) as company_name")
->join('tab_promote_company on tab_promote_company.service_agreement_show = tab_service_agreement.id', 'LEFT')->where($map)->page($p, $row)->order("status desc")->select();
$count = M('service_agreement', 'tab_')->where($map)->count();
$page = set_pagination($count, $row);
if ($page) {
@ -617,4 +619,11 @@ WHERE old_change_promote_id in ({$promoteData})";
}
}
public function serviceAgreementSetDefault($id)
{
M('service_agreement', 'tab_')->save(['status'=>1]);
M('service_agreement', 'tab_')->where(['id'=>$id])->save(['status'=>2]);
return $this->success('设置完成');
}
}

@ -60,6 +60,8 @@
</th> -->
<th>ID</th>
<th>标题</th>
<th>是否默认合同</th>
<th>应用公司</th>
<th>操作人</th>
<th>操作时间</th>
<th>操作</th>
@ -75,9 +77,14 @@
<!-- <td><input class="ids" type="checkbox" value="{$data['id']}" name="ids"></td> -->
<td>{$data.id}</td>
<td>{$data.name}</td>
<td>{$data.status}</td>
<td><textarea disabled>{$data.company_name}</textarea></td>
<td>{:get_admin_nickname($data['creator'])}</td>
<td>{$data.created_time|date='Y-m-d H:i:s',###}</td>
<td>
<?php if ($data['status'] == 1):?>
<a class="ajax-get" href="{:U('PromoteCompany/serviceAgreementSetDefault',array('id'=>$data['id']))}">设置默认 </a>
<?php endif;?>
<a href="{:U('PromoteCompany/serviceAgreementSave',array('id'=>$data['id']))}">编辑 </a>
<a class="ajax-get" href="{:U('PromoteCompany/serviceAgreementSave',array('id'=>$data['id'], 'delete'=>1))}">删除 </a>
</td>

Loading…
Cancel
Save