|
|
|
@ -249,8 +249,19 @@ class PromoteCompanyController extends ThinkController
|
|
|
|
|
if (empty($data)) {
|
|
|
|
|
$this->error('数据异常', U('lists'));
|
|
|
|
|
}
|
|
|
|
|
$data['contact_begin']=date("Y-m-d",$data['contact_begin']);
|
|
|
|
|
$data['contact_end']=date("Y-m-d",$data['contact_end']);
|
|
|
|
|
if($data['contact_begin'] >0){
|
|
|
|
|
$data['contact_begin']=date("Y-m-d",$data['contact_begin']);
|
|
|
|
|
}else{
|
|
|
|
|
$data['contact_begin']='';
|
|
|
|
|
}
|
|
|
|
|
if($data['contact_end'] >0){
|
|
|
|
|
$data['contact_end']=date("Y-m-d",$data['contact_end']);
|
|
|
|
|
}else{
|
|
|
|
|
$data['contact_end']='';
|
|
|
|
|
}
|
|
|
|
|
if($data['resources'] == ''){
|
|
|
|
|
$data['resources'] ="[]";
|
|
|
|
|
}
|
|
|
|
|
$this->assign('data', $data);
|
|
|
|
|
$this->display();
|
|
|
|
|
}
|
|
|
|
@ -293,8 +304,19 @@ class PromoteCompanyController extends ThinkController
|
|
|
|
|
if (empty($data)) {
|
|
|
|
|
$this->error('数据异常', U('lists'));
|
|
|
|
|
}
|
|
|
|
|
$data['contact_begin']=date("Y-m-d",$data['contact_begin']);
|
|
|
|
|
$data['contact_end']=date("Y-m-d",$data['contact_end']);
|
|
|
|
|
if($data['contact_begin'] >0){
|
|
|
|
|
$data['contact_begin']=date("Y-m-d",$data['contact_begin']);
|
|
|
|
|
}else{
|
|
|
|
|
$data['contact_begin']='';
|
|
|
|
|
}
|
|
|
|
|
if($data['contact_end'] >0){
|
|
|
|
|
$data['contact_end']=date("Y-m-d",$data['contact_end']);
|
|
|
|
|
}else{
|
|
|
|
|
$data['contact_end']='';
|
|
|
|
|
}
|
|
|
|
|
if($data['resources'] == ''){
|
|
|
|
|
$data['resources'] ="[]";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$this->assign('data', $data);
|
|
|
|
|
$this->display();
|
|
|
|
@ -304,20 +326,29 @@ class PromoteCompanyController extends ThinkController
|
|
|
|
|
//删除
|
|
|
|
|
public function del()
|
|
|
|
|
{
|
|
|
|
|
if (!empty($_POST['ids'])) {
|
|
|
|
|
if (!is_array($_POST['ids'])) {
|
|
|
|
|
$model = M($this->modelName, 'tab_');
|
|
|
|
|
if (!empty($_POST['id'])) {
|
|
|
|
|
if (!is_array($_POST['id'])) {
|
|
|
|
|
$this->error('参数异常');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$id = implode(',', $_POST['ids']);
|
|
|
|
|
$id = $_POST['id'];
|
|
|
|
|
} else {
|
|
|
|
|
$id = intval(I('get.id', 0));
|
|
|
|
|
if ($id == 0) {
|
|
|
|
|
$this->error('参数异常');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$res = M($this->modelName, 'tab_')->delete($id);
|
|
|
|
|
//删除所有资源
|
|
|
|
|
$data = $model->field('resources')->find($id)['resources'];
|
|
|
|
|
$data = json_encode($data,true);
|
|
|
|
|
if(is_array($data) && count($data) >0){
|
|
|
|
|
foreach($data as $k=>$v){
|
|
|
|
|
unlink("./".$v['file_path']);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$res = $model->delete($id);
|
|
|
|
|
//删除对应的推广员
|
|
|
|
|
if ($res === false) {
|
|
|
|
|
$this->error('删除失败');
|
|
|
|
|
}
|
|
|
|
|