修复
This commit is contained in:
@@ -25,9 +25,14 @@ class FeishuController
|
||||
*/
|
||||
public function getinfo(Request $request)
|
||||
{
|
||||
$config = Util::getParam($request, 'config');
|
||||
if (Util::isEmpty($config)) {
|
||||
$config = $this->config;
|
||||
// $config = Util::getParam($request, 'config');
|
||||
// if (Util::isEmpty($config)) {
|
||||
// $config = $this->config;
|
||||
// }
|
||||
$userId = $request->user['id'];
|
||||
$config = User::where('id',$userId)->value('sign');
|
||||
if(Util::isEmpty($config)){
|
||||
return Util::fail(null,trans('sign_not_null'));
|
||||
}
|
||||
|
||||
// 获取凭证
|
||||
@@ -48,13 +53,10 @@ class FeishuController
|
||||
public function getSign(Request $request)
|
||||
{
|
||||
|
||||
// 获取凭证
|
||||
$certificate = config('feishu');
|
||||
|
||||
$res = [];
|
||||
foreach ($certificate as $k => $v) {
|
||||
$res []=['id'=>$k,'name'=>$k];
|
||||
}
|
||||
$res = [['xinyouhe'=>'新友合'],['mbaf'=>'MAGIC BRIDGE AUTO FZE']];
|
||||
// foreach ($certificate as $k => $v) {
|
||||
// $res []=['id'=>$k,'name'=>$k];
|
||||
// }
|
||||
return Util::success($res,trans('success'));
|
||||
}
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ class UserController
|
||||
$result['token'] = $token;
|
||||
$result['feishu_openid'] = FeishuUser::where('user_id', $userId)->value('open_id');
|
||||
|
||||
if (Util::isEmpty($language)) {
|
||||
if (!Util::isEmpty($language)) {
|
||||
User::where('id', $userId)
|
||||
->update(['language' => $language]);
|
||||
locale($language);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace process;
|
||||
namespace app\process;
|
||||
|
||||
use app\controller\FeishuController;
|
||||
use app\model\Customer;
|
||||
@@ -11,10 +11,11 @@ use Workerman\Crontab\Crontab;
|
||||
|
||||
class Task
|
||||
{
|
||||
|
||||
public function onWorkerStart()
|
||||
{
|
||||
// 每半小时执行一次
|
||||
new Crontab('30/* * * * *', function () {
|
||||
new Crontab('1/* * * * * *', function () {
|
||||
echo date('Y-m-d H:i:s') . "\n";
|
||||
$customer = Customer::where(['follow_next', '<=', time() + 3600])
|
||||
->where(['follow_next', '>', time()])
|
||||
@@ -31,6 +32,8 @@ class Task
|
||||
$host = $parsedUrl['host'];
|
||||
$port = isset($parsedUrl['port']) ? ':' . $parsedUrl['port'] : '';
|
||||
$url = $host .$port. '/pages/customer/detile?id='.$customer->id;
|
||||
$item->warn = 1;
|
||||
$item->update();
|
||||
FeishuController::class->send($feishuUser->open_id, '跟进提醒', '您有新的跟进提醒', $url);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -192,7 +192,7 @@ class FeishuService
|
||||
"client_id" => $this->appId,
|
||||
"client_secret" => $this->appSecret,
|
||||
"code" => $code,
|
||||
"redirect_uri" => 'http://219.157.255.213:8085/pages/index/webview'
|
||||
"redirect_uri" => $redirect_uri
|
||||
];
|
||||
return $this->requestResult('authen/v2/oauth/token');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user