130 lines
5.1 KiB
PHP
130 lines
5.1 KiB
PHP
<?php
|
|
|
|
namespace app\admin\controller;
|
|
|
|
use think\Controller;
|
|
use think\Db;
|
|
use app\bj\controller\Common;
|
|
use think\Log;
|
|
use \think\Validate;
|
|
|
|
class Technology extends Base{
|
|
|
|
|
|
protected $page_num = 10;
|
|
################################################################管理后台################################################################
|
|
################################################################管理后台################################################################
|
|
################################################################管理后台################################################################
|
|
public function index($page = 1){
|
|
$data = input();
|
|
$pd = true;
|
|
$parameter = [];
|
|
// $parameter['is_del'] = 0;
|
|
if(array_key_exists('tt', $data)){
|
|
$page = $data['page_num'];
|
|
unset($data['page_num']);
|
|
unset($data['tt']);
|
|
$pd = false;
|
|
//
|
|
// if($data['status_num'] === "0" || $data['status_num'] === "1"){
|
|
// $parameter['is_del'] = $data['status_num'];
|
|
// }
|
|
|
|
// if($data['tel']){
|
|
// $parameter['tel'] = $data['tel'];
|
|
// }
|
|
// if($data['email']){
|
|
// $parameter['email'] = $data['email'];
|
|
// }
|
|
// if($data['s_time']){
|
|
// $parameter['create_time'] = ['>=',$data['s_time']];
|
|
// }
|
|
// if($data['e_time']){
|
|
// $parameter['create_time'] = ['<=',$data['e_time']];
|
|
// }
|
|
}
|
|
$num = Db::table('admin_technology')->where($parameter)->count();
|
|
$result = Db::table('admin_technology')->where($parameter)->order('is_del,id desc')->page($page,$this->page_num)->select();
|
|
if(!$pd){
|
|
$result['num'] = $num;
|
|
$result['data'] = $result;
|
|
return $this->msg(0,'success',$result);
|
|
}
|
|
$this->assign([
|
|
'result' => $result,
|
|
'num' => $num,
|
|
]);
|
|
return $this->fetch();
|
|
}
|
|
|
|
// public function ceshiyong(){
|
|
// $data = input();
|
|
// $data = json_decode($data['data'],true);
|
|
// // dump($data);
|
|
// // die;
|
|
// $result_return = [['name'=>'请选择','list'=>['请选择']]];
|
|
// foreach ($data as $key => $value) {
|
|
// array_push($result_return,[
|
|
// 'name'=>$value['name'],
|
|
// 'list'=>[]
|
|
// ]);
|
|
// foreach ($value['cityList'] as $key_list => $value_list) {
|
|
// array_push($result_return[count($result_return)-1]['list'],$value_list['name']);
|
|
// }
|
|
// }
|
|
// $aaa = Db::table('admin_estimate')->insert([
|
|
// 'content'=>json_encode($result_return),
|
|
// 'type'=>2,
|
|
// ]);
|
|
// // dump($data);
|
|
// }
|
|
|
|
|
|
################################################################页面################################################################
|
|
################################################################页面################################################################
|
|
################################################################页面################################################################
|
|
// 技术支持手机网页端
|
|
public function web_index(){
|
|
// dump(123);
|
|
// die;
|
|
return $this->fetch();
|
|
}
|
|
// 隐私协议手机网页端
|
|
public function privacy_index(){
|
|
// dump(123);
|
|
// die;
|
|
return $this->fetch();
|
|
}
|
|
################################################################调用################################################################
|
|
################################################################调用################################################################
|
|
################################################################调用################################################################
|
|
|
|
public function set_user_opinion(){
|
|
$data = input();
|
|
if(!array_key_exists('content', $data) || !array_key_exists('tel', $data)){
|
|
return $this->msg(10001);
|
|
}
|
|
$contact_information = $this->is_tel_email($data['tel']);
|
|
if($contact_information == false){
|
|
return $this->msg(10005,'手机或邮箱格式错误');
|
|
}
|
|
$result = Db::table('admin_technology')->insert([
|
|
'contact_information'=>$data['tel'],
|
|
'content_problem'=>$data['content'],
|
|
'account_information'=>'',
|
|
'create_time'=>date('Y-m-d H:i:s'),
|
|
]);
|
|
if($result){
|
|
return $this->msg([]);
|
|
}else{
|
|
return $this->msg(10002);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
################################################################other################################################################
|
|
################################################################other################################################################
|
|
################################################################other################################################################
|
|
|
|
} |