调整快捷上传视频
This commit is contained in:
parent
b111bf2f62
commit
656108fcc9
@ -12,6 +12,9 @@ use think\App;
|
|||||||
class Upload extends BaseController
|
class Upload extends BaseController
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var CommunityRepository
|
||||||
|
*/
|
||||||
public $repository;
|
public $repository;
|
||||||
|
|
||||||
public function __construct(App $app)
|
public function __construct(App $app)
|
||||||
@ -60,7 +63,7 @@ class Upload extends BaseController
|
|||||||
$topicIds = [40 => 69, 42 => 70, 43 => 73];
|
$topicIds = [40 => 69, 42 => 70, 43 => 73];
|
||||||
$userIndex = array_rand($users);
|
$userIndex = array_rand($users);
|
||||||
$userPhone = $users[$userIndex]['phone'];
|
$userPhone = $users[$userIndex]['phone'];
|
||||||
$userId = User::getInstance()->where('phone', $userPhone)->value('uid');
|
$userId = User::getInstance()->where('account', $userPhone)->value('uid');
|
||||||
$topicId = array_rand($topicIds);
|
$topicId = array_rand($topicIds);
|
||||||
$categoryId = $topicIds[$topicId];
|
$categoryId = $topicIds[$topicId];
|
||||||
$filename = rtrim($file->getOriginalName(), '.mp4');
|
$filename = rtrim($file->getOriginalName(), '.mp4');
|
||||||
@ -76,9 +79,8 @@ class Upload extends BaseController
|
|||||||
'uid' => $userId,
|
'uid' => $userId,
|
||||||
];
|
];
|
||||||
$data = $this->checkParams($community);
|
$data = $this->checkParams($community);
|
||||||
$res = $this->repository->create($data);
|
$id = $this->repository->create($data);
|
||||||
halt($res);
|
return app('json')->success('上传成功', ['id' => $id, 'user_id' => $userId, 'phone' => $userPhone]);
|
||||||
return app('json')->success('上传成功');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function checkParams($data)
|
public function checkParams($data)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user