Skip to content

Commit

Permalink
Update V10.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
idcsmart committed Mar 9, 2023
1 parent d76ffac commit 926c735
Show file tree
Hide file tree
Showing 1,466 changed files with 542,777 additions and 4,231 deletions.
25 changes: 23 additions & 2 deletions app/admin/controller/AppMarketController.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public function install(){

$dir = WEB_ROOT.$result['data']['app']['uuid'].'.zip';

$content = curl_download($this->market_url."/console/v1/app_market/market/download?id={$id}&from=".request()->domain().'/'.DIR_ADMIN.'&token='.$token.'&time='.time(), $dir);
$content = $this->curl_download($this->market_url."/console/v1/app_market/market/download?id={$id}&from=".request()->domain().'/'.DIR_ADMIN.'&token='.$token.'&time='.time(), $dir);

if($content){

Expand All @@ -163,7 +163,7 @@ public function install(){
}
}else{
$dir = WEB_ROOT."plugins/".$result['data']['app']['type'].'/'.$result['data']['app']['uuid'].'.zip';
$content = curl_download($this->market_url."/console/v1/app_market/market/download?id={$id}&from=".request()->domain().'/'.DIR_ADMIN.'&token='.$token.'&time='.time(), $dir);
$content = $this->curl_download($this->market_url."/console/v1/app_market/market/download?id={$id}&from=".request()->domain().'/'.DIR_ADMIN.'&token='.$token.'&time='.time(), $dir);
if($content){

$file = WEB_ROOT."plugins/".$result['data']['app']['type'];
Expand Down Expand Up @@ -204,4 +204,25 @@ private function unzip($filepath,$path)
return ['status' => 400 , 'msg' => $res];
}
}

/*
* curl下载解压包到指定路径
*/
private function curl_download($url, $file_name)
{
$ch = curl_init($url);
//设置抓取的url
$dir = $file_name;
$fp = fopen($dir, "wb");
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_HEADER, 0);

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
$res=curl_exec($ch);
curl_close($ch);
fclose($fp);

return $res;
}
}
64 changes: 64 additions & 0 deletions app/admin/controller/ConfigurationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -530,5 +530,69 @@ public function certificationUpdate()

return json($result);
}

/**
* 时间 2023-02-28
* @title 获取信息配置
* @desc 获取信息配置
* @url /admin/v1/configuration/info
* @method GET
* @author theworld
* @version v1
* @return string put_on_record - 备案信息
* @return string enterprise_name - 企业名称
* @return string enterprise_telephone - 企业电话
* @return string enterprise_mailbox - 企业邮箱
* @return string enterprise_qrcode - 企业二维码
* @return string online_customer_service_link - 在线客服链接
*/
public function infoList()
{
//实例化模型类
$ConfigurationModel = new ConfigurationModel();

//获取信息配置
$data = $ConfigurationModel->infoList();
$result = [
'status' => 200,
'msg' => lang('success_message'),
'data' => $data,
];
return json($result);
}

/**
* 时间 2023-02-28
* @title 保存信息配置
* @desc 保存信息配置
* @url /admin/v1/configuration/info
* @method PUT
* @author theworld
* @version v1
* @param string put_on_record - 备案信息 required
* @param string enterprise_name - 企业名称 required
* @param string enterprise_telephone - 企业电话 required
* @param string enterprise_mailbox - 企业邮箱 required
* @param string enterprise_qrcode - 企业二维码 required
* @param string online_customer_service_link - 在线客服链接 required
*/
public function infoUpdate()
{
//接收参数
$param = $this->request->param();

//参数验证
if (!$this->validate->scene('info_update')->check($param)){
return json(['status' => 400 , 'msg' => lang($this->validate->getError())]);
}

//实例化模型类
$ConfigurationModel = new ConfigurationModel();

//保存信息配置
$result = $ConfigurationModel->infoUpdate($param);

return json($result);
}
}

55 changes: 55 additions & 0 deletions app/admin/controller/ConsultController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?php
namespace app\admin\controller;

use app\common\model\ConsultModel;

/**
* @title 方案咨询
* @desc 方案咨询
* @use app\admin\controller\ConsultController
*/
class ConsultController extends AdminBaseController
{
/**
* 时间 2023-02-28
* @title 方案咨询列表
* @desc 方案咨询列表
* @author theworld
* @version v1
* @url /admin/v1/consult
* @method GET
* @param int page - 页数
* @param int limit - 每页条数
* @param string orderby - 排序 id
* @param string sort - 升/降序 asc,desc
* @return array list - 方案咨询
* @return int list[].id - 方案咨询ID
* @return string list[].matter - 咨询事项
* @return string list[].contact - 联系人
* @return string list[].company - 公司名称
* @return string list[].phone - 联系电话
* @return string list[].email - 联系邮箱
* @return int list[].client_id - 用户ID
* @return string list[].username - 用户名
* @return int list[].create_time - 咨询时间
* @return int count - 方案咨询总数
*/
public function list()
{
// 合并分页参数
$param = array_merge($this->request->param(), ['page' => $this->request->page, 'limit' => $this->request->limit, 'sort' => $this->request->sort]);

// 实例化模型类
$ConsultModel = new ConsultModel();

// 获取方案咨询列表
$data = $ConsultModel->consultList($param);

$result = [
'status' => 200,
'msg' => lang('success_message'),
'data' => $data
];
return json($result);
}
}
180 changes: 180 additions & 0 deletions app/admin/controller/FeedbackController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
<?php
namespace app\admin\controller;

use app\common\model\FeedbackModel;
use app\common\model\FeedbackTypeModel;
use app\admin\validate\FeedbackTypeValidate;

/**
* @title 意见反馈
* @desc 意见反馈
* @use app\admin\controller\FeedbackController
*/
class FeedbackController extends AdminBaseController
{
public function initialize()
{
parent::initialize();
$this->validate = new FeedbackTypeValidate();
}

/**
* 时间 2023-02-28
* @title 意见反馈列表
* @desc 意见反馈列表
* @author theworld
* @version v1
* @url /admin/v1/feedback
* @method GET
* @param int page - 页数
* @param int limit - 每页条数
* @param string orderby - 排序 id
* @param string sort - 升/降序 asc,desc
* @return array list - 意见反馈
* @return int list[].id - 意见反馈ID
* @return string list[].title - 标题
* @return string list[].type - 类型
* @return string list[].description - 描述
* @return int list[].client_id - 用户ID
* @return string list[].username - 用户名
* @return string list[].contact - 联系方式
* @return array list[].attachment - 附件
* @return int list[].create_time - 反馈时间
* @return int count - 意见反馈总数
*/
public function feedbackList()
{
// 合并分页参数
$param = array_merge($this->request->param(), ['page' => $this->request->page, 'limit' => $this->request->limit, 'sort' => $this->request->sort]);

// 实例化模型类
$FeedbackModel = new FeedbackModel();

// 获取意见反馈列表
$data = $FeedbackModel->feedbackList($param);

$result = [
'status' => 200,
'msg' => lang('success_message'),
'data' => $data
];
return json($result);
}

/**
* 时间 2023-02-28
* @title 获取意见反馈类型
* @desc 获取意见反馈类型
* @author theworld
* @version v1
* @url /admin/v1/feedback/type
* @method GET
* @return array list - 意见反馈类型
* @return int list[].id - 意见反馈类型ID
* @return string list[].name - 名称
* @return string list[].description - 描述
*/
public function feedbackTypeList()
{
// 实例化模型类
$FeedbackTypeModel = new FeedbackTypeModel();

// 获取意见反馈类型
$data = $FeedbackTypeModel->feedbackTypeList();

$result = [
'status' => 200,
'msg' => lang('success_message'),
'data' => $data
];
return json($result);
}

/**
* 时间 2023-02-28
* @title 添加意见反馈类型
* @desc 添加意见反馈类型
* @author theworld
* @version v1
* @url /admin/v1/feedback/type
* @method POST
* @param string name - 名称 required
* @param string description - 描述 required
*/
public function createFeedbackType()
{
// 接收参数
$param = $this->request->param();

// 参数验证
if (!$this->validate->scene('create')->check($param)){
return json(['status' => 400 , 'msg' => lang($this->validate->getError())]);
}

// 实例化模型类
$FeedbackTypeModel = new FeedbackTypeModel();

// 新建意见反馈类型
$result = $FeedbackTypeModel->createFeedbackType($param);

return json($result);
}

/**
* 时间 2023-02-28
* @title 编辑意见反馈类型
* @desc 编辑意见反馈类型
* @author theworld
* @version v1
* @url /admin/v1/feedback/type/:id
* @method PUT
* @param int id - 意见反馈类型ID required
* @param string name - 名称 required
* @param string description - 描述 required
*/
public function updateFeedbackType()
{
// 接收参数
$param = $this->request->param();

// 参数验证
if (!$this->validate->scene('update')->check($param)){
return json(['status' => 400 , 'msg' => lang($this->validate->getError())]);
}

// 实例化模型类
$FeedbackTypeModel = new FeedbackTypeModel();

// 修改意见反馈类型
$result = $FeedbackTypeModel->updateFeedbackType($param);

return json($result);
}

/**
* 时间 2023-02-28
* @title 删除意见反馈类型
* @desc 删除意见反馈类型
* @author theworld
* @version v1
* @url /admin/v1/feedback/type/:id
* @method DELETE
* @param int id - 意见反馈类型ID required
*/
public function deleteFeedbackType()
{
// 接收参数
$param = $this->request->param();

// 实例化模型类
$FeedbackTypeModel = new FeedbackTypeModel();

// 删除意见反馈类型
$result = $FeedbackTypeModel->deleteFeedbackType($param['id']);

return json($result);

}


}
Loading

0 comments on commit 926c735

Please sign in to comment.