|
...
|
...
|
@@ -51,12 +51,16 @@ class ProjectAssociationController extends BaseController |
|
|
|
$this->response('success');
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 获取aicc用户列表 并返回绑定的数据
|
|
|
|
* @return array|void
|
|
|
|
*/
|
|
|
|
public function check()
|
|
|
|
{
|
|
|
|
$project_id = (int)request()->input('project_id', 0);
|
|
|
|
$status = request()->input('status');
|
|
|
|
// 重载redis缓存
|
|
|
|
$cache = request()->input('cache');
|
|
|
|
$cache = request()->input('cache');
|
|
|
|
if (isset($status)) {
|
|
|
|
$status = (int)$status ? ProjectAssociation::STATUS_NORMAL : ProjectAssociation::STATUS_DISABLED;
|
|
|
|
}
|
|
...
|
...
|
@@ -87,17 +91,19 @@ class ProjectAssociationController extends BaseController |
|
|
|
}
|
|
|
|
} catch (\Exception $exception) {
|
|
|
|
DB::rollBack();
|
|
|
|
$this->response('数据错误,请重试!', Code::SERVER_ERROR);
|
|
|
|
// 数据错误,请重试
|
|
|
|
$this->response('error', Code::SERVER_ERROR);
|
|
|
|
}
|
|
|
|
if (is_null($isRes)) {
|
|
|
|
$this->response('请开启AICC绑定!', Code::USER_ERROR, []);
|
|
|
|
// 请开启AICC绑定
|
|
|
|
$this->response('success', Code::SERVER_ERROR);
|
|
|
|
}
|
|
|
|
$redis_key = 'aicc_friend_lists_' . (int)env('AICC_WECHAT_USER_ID');
|
|
|
|
$result = isset($cache) ? false : redis_get($redis_key);
|
|
|
|
if (empty($result)) {
|
|
|
|
$url = env('AICC_URL') . env('AICC_WECHAT_FRIEND_API_URL');
|
|
|
|
$result = curlGet($url);
|
|
|
|
redis_set($redis_key, json_encode($result));
|
|
|
|
redis_set($redis_key, json_encode($result), 60);
|
|
|
|
} else {
|
|
|
|
$result = json_decode($result, true);
|
|
|
|
}
|
...
|
...
|
|