add:使用通用的redis logic
This commit is contained in:
parent
8f3c044f41
commit
178203bae6
@ -14,6 +14,7 @@
|
||||
namespace app\api\controller;
|
||||
|
||||
use app\api\logic\IndexLogic;
|
||||
use app\common\logic\RedisLogic;
|
||||
use app\common\model\Company;
|
||||
use app\common\model\company\CompanyProperty;
|
||||
use app\common\model\contract\VehicleContract;
|
||||
@ -431,7 +432,7 @@ class IndexController extends BaseApiController
|
||||
if ($parmas) {
|
||||
$data=json_decode($parmas['data'],true);
|
||||
// 成功回调标记
|
||||
$redis = new Redis(['host'=>'redis']);
|
||||
$redis = RedisLogic::getInstance();
|
||||
$cache = $redis->get('authentication_company_id_'.$parmas['id']);
|
||||
if (!empty($cache)) {
|
||||
$data = json_decode($cache, true);
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
namespace app\task;
|
||||
|
||||
use app\common\logic\RedisLogic;
|
||||
use app\common\model\Company;
|
||||
use app\common\model\task\Task as TaskTask;
|
||||
use think\cache\driver\Redis;
|
||||
@ -21,7 +22,7 @@ class TaskCompanyAuthNotifyCron extends Task
|
||||
*/
|
||||
protected function execute()
|
||||
{
|
||||
$redis = new Redis(['host'=>'redis']);
|
||||
$redis = RedisLogic::getInstance();
|
||||
//...具体的任务执行
|
||||
$companyIdList = $redis->keys('authentication_company_id_*');
|
||||
foreach ($companyIdList as $key) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user