Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
@@ -1,69 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace app\common\model;
|
||||
|
||||
use support\Model;
|
||||
|
||||
/**
|
||||
* user_feishu_app 用户-飞书应用
|
||||
* @property integer $id ID(主键)
|
||||
* @property integer $uid 用户ID
|
||||
* @property integer $corp_id 公司ID
|
||||
* @property string $name 名称
|
||||
* @property string $mobile 手机
|
||||
* @property string $union_id ISV的唯一标识
|
||||
* @property string $user_id 用户 user_id
|
||||
* @property string $open_id 应用内的唯一标识
|
||||
* @property string $tenant_key 当前企业标识
|
||||
* @property integer $sort 排序
|
||||
* @property integer $status 状态
|
||||
* @property integer $created_at 创建时间
|
||||
* @property integer $updated_at 更新时间
|
||||
*/
|
||||
class UserFeishuApp extends Model
|
||||
{
|
||||
/**
|
||||
* The connection name for the model.
|
||||
*
|
||||
* @var string|null
|
||||
*/
|
||||
protected $connection = 'mysql';
|
||||
|
||||
/**
|
||||
* The table associated with the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'user_feishu_app';
|
||||
|
||||
/**
|
||||
* The primary key associated with the table.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $primaryKey = 'id';
|
||||
|
||||
/**
|
||||
* Indicates if the model should be timestamped.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
public $timestamps = true;
|
||||
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
|
||||
|
||||
protected $fillable = [
|
||||
'uid',
|
||||
'corp_id',
|
||||
'name',
|
||||
'mobile',
|
||||
'union_id',
|
||||
'user_id',
|
||||
'open_id',
|
||||
'tenant_key',
|
||||
'sort',
|
||||
'status'
|
||||
];
|
||||
}
|
||||
@@ -23,7 +23,7 @@ class ConversationController extends BaseController
|
||||
public function add(Request $request)
|
||||
{
|
||||
try {
|
||||
$request->setPost('user_id', 1);
|
||||
$request->setPost('user_id', $request->user->uid);
|
||||
return (new ConversationService())->add($request->all())
|
||||
? $this->success()
|
||||
: $this->error();
|
||||
@@ -34,7 +34,7 @@ class ConversationController extends BaseController
|
||||
public function edit(Request $request)
|
||||
{
|
||||
try {
|
||||
$request->setPost('user_id', 1);
|
||||
$request->setPost('user_id', $request->user->uid);
|
||||
$result = (new ConversationService())->edit($request->all());
|
||||
return $result
|
||||
? $this->success($result)
|
||||
|
||||
@@ -17,10 +17,28 @@ class TicketController extends BaseController
|
||||
return $this->error($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 我的工单
|
||||
* @param Request $request
|
||||
* @return \support\Response
|
||||
*/
|
||||
public function self(Request $request)
|
||||
{
|
||||
try {
|
||||
$request->setGet('user_id',$request->user->uid);
|
||||
$result = (new TicketService())->list($request->all());
|
||||
return $this->success($result);
|
||||
// return $this->success($this->page($result));
|
||||
} catch (\Throwable $e) {
|
||||
return $this->error($e->getMessage().' '.$e->getLine().' '.$e->getFile().' '.$e->getTraceAsString());
|
||||
}
|
||||
}
|
||||
|
||||
public function add(Request $request)
|
||||
{
|
||||
try {
|
||||
$request->setPost('user_id', 1);
|
||||
$request->setPost('user_id', $request->user->uid);
|
||||
|
||||
return (new TicketService())->add($request->all())
|
||||
? $this->success()
|
||||
@@ -33,7 +51,7 @@ class TicketController extends BaseController
|
||||
public function edit(Request $request)
|
||||
{
|
||||
try {
|
||||
$request->setPost('user_id', 1);
|
||||
$request->setPost('user_id', $request->user->uid);
|
||||
$result = (new TicketService())->edit($request->all());
|
||||
return $result
|
||||
? $this->success($result)
|
||||
@@ -45,7 +63,7 @@ class TicketController extends BaseController
|
||||
public function status(Request $request)
|
||||
{
|
||||
try {
|
||||
$request->setPost('user_id', 1);
|
||||
$request->setPost('user_id', $request->user->uid);
|
||||
$result = (new TicketService())->status($request->all());
|
||||
return $result
|
||||
? $this->success($result)
|
||||
|
||||
@@ -20,11 +20,15 @@ class TicketLogic
|
||||
if(!empty($params['categorie_id'])){
|
||||
$where[] = ['categorie_id', '=', $params['categorie_id']];
|
||||
}
|
||||
if(!empty($params['user_id'])){
|
||||
$where[] = ['user_id', '=', $params['user_id']];
|
||||
}
|
||||
if(!empty($params['status'])){
|
||||
$where[] = ['status', '=', $params['status']];
|
||||
}
|
||||
$size = $params['size'];
|
||||
$current = $params['current'];
|
||||
|
||||
return Ticket::with('attachments')->with('categorie')->with('categorie.translation')->where($where)->orderBy('id','desc')->paginate($size, ['*'], 'page', $current);
|
||||
}
|
||||
public function add(array $data)
|
||||
|
||||
@@ -59,6 +59,7 @@ Route::group('/ticket', function () {
|
||||
Route::any('/ticket/add', [app\ticket\controller\TicketController::class, 'add']);
|
||||
Route::any('/ticket/edit', [app\ticket\controller\TicketController::class, 'edit']);
|
||||
Route::any('/ticket/list', [app\ticket\controller\TicketController::class, 'index']);
|
||||
Route::any('/ticket/self', [app\ticket\controller\TicketController::class, 'self']);
|
||||
Route::any('/ticket/status', [app\ticket\controller\TicketController::class, 'status']);
|
||||
Route::any('/ticket/getStatus', [app\ticket\controller\TicketController::class, 'getStatus']);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user