You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
65 lines
2.4 KiB
65 lines
2.4 KiB
<?php
|
|
// +----------------------------------------------------------------------
|
|
// | Niucloud-admin 企业快速开发的多应用管理平台
|
|
// +----------------------------------------------------------------------
|
|
// | 官方网址:https://www.niucloud.com
|
|
// +----------------------------------------------------------------------
|
|
// | niucloud团队 版权所有 开源版本可自由商用
|
|
// +----------------------------------------------------------------------
|
|
// | Author: Niucloud Team
|
|
// +----------------------------------------------------------------------
|
|
|
|
namespace app\api\controller\apiController;
|
|
|
|
use app\Request;
|
|
use app\service\api\apiService\CommonService;
|
|
use app\service\api\apiService\CommunicationRecordsService;
|
|
use core\base\BaseApiService;
|
|
|
|
/**
|
|
* 沟通记录相关接口
|
|
* Class Personnel
|
|
* @package app\api\controller\apiController
|
|
*/
|
|
class CommunicationRecords extends BaseApiService
|
|
{
|
|
|
|
//获取字典
|
|
public function add(Request $request){
|
|
|
|
|
|
$date = date('Y-m-d H:i:s');
|
|
$data = [
|
|
'staff_id' => $request->param('staff_id', ''),//
|
|
'resource_id' => $request->param('resource_id', ''),//
|
|
'resource_type' => $request->param('resource_type', ''),//资源类型(如设备、文件、系统等)
|
|
'communication_type' => $request->param('communication_type', ''),//
|
|
'communication_result' => $request->param('communication_result', ''),//沟通结果: success-成功, failure-失败, pending-待定
|
|
'communication_time' => $request->param('communication_time', $date),//沟通时间
|
|
'remarks' => $request->param('remarks', ''),//备注
|
|
'tag' => $request->param('tag', null),//标签:|默认null high-高, medium-中, low-低
|
|
];
|
|
|
|
$res = (new CommunicationRecordsService())->add($data);
|
|
if(!$res['code']){
|
|
return fail('操作失败');
|
|
}
|
|
return success('操作成功');
|
|
}
|
|
public function edit(Request $request){
|
|
$date = date('Y-m-d H:i:s');
|
|
$where = [
|
|
['id', '=', $request->param('id', '')],
|
|
];
|
|
$data = [
|
|
'remarks' => $request->param('remarks', ''),//备注
|
|
'updated_at' => $date
|
|
];
|
|
|
|
$res = (new CommunicationRecordsService())->edit($where,$data);
|
|
if(!$res['code']){
|
|
return fail('操作失败');
|
|
}
|
|
return success('操作成功');
|
|
}
|
|
}
|
|
|