96 lines
3.2 KiB
PHP
96 lines
3.2 KiB
PHP
<?php
|
|
|
|
namespace app\admin\controller;
|
|
|
|
use think\Db;
|
|
use think\Log;
|
|
|
|
|
|
class Estimate extends Base{
|
|
|
|
protected $page_num = 10;
|
|
protected $file_max = 1024*1024*5;//xxxMB
|
|
################################################################接口################################################################
|
|
################################################################接口################################################################
|
|
################################################################接口################################################################
|
|
// 获取系统设备列表
|
|
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_estimate')->where($parameter)->count();
|
|
$result = Db::table('admin_estimate')->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 estimate_add(){
|
|
return $this->fetch();
|
|
}
|
|
|
|
################################################################业务接口################################################################
|
|
################################################################业务接口################################################################
|
|
|
|
################################################device_data_list
|
|
public function device_data_list_action($data){
|
|
$result = Db::table('app_device_data')->where(['is_del'=>0])->field('id,name,pic,content,page_measure,bluetooth_type,device_model')->select();
|
|
foreach ($result as $key => $value) {
|
|
unset($result[$key]['ROW_NUMBER']);
|
|
}
|
|
if(empty($result)){
|
|
return $this->msg(10004);
|
|
}else{
|
|
return $this->msg(['list'=>$result]);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
################################################################其他接口################################################################
|
|
################################################################其他接口################################################################
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |