7, 'item' => 1, 'item_text' => 'page', 'logo' => 'http://lanzutest.lanzulive.com/attachment/images/2/2020/08/PY55Y3Mz17yJo17rv1Z7vImX1V5159.jpg', 'redirect_url' => '/zh_cjdianc/pages/takeout/takeoutindex?storeid=123', 'src' => '/zh_cjdianc/pages/takeout/takeoutindex?storeid=123', 'src2' => '/zh_cjdianc/pages/takeout/takeoutindex?storeid=123', ]; return $res; } public function ssdbPurchaseRecord($data,$user_id,$global_order_id) { foreach ($data as $k => $v){ if($v['money'] == 0.01){ //添加特价商品购买记录到ssdb $ssdb = ApplicationContext::getContainer()->get(SSDBTask::class); $ssdb->exec('set', SsdbKeysPrefix::PURCHASE_RECORD. date('Ymd') .'_'.$user_id.'_'.$v['good_id'], $global_order_id); $end_timestamp = strtotime(date('Y-m-d').'23:59:59'); $end_time = $end_timestamp - time(); $ssdb->exec('expire', SsdbKeysPrefix::PURCHASE_RECORD. date('Ymd') .'_'.$user_id.'_'.$v['good_id'],$end_time); } } return true; } public function test($params) { $ssdb = ApplicationContext::getContainer()->get(SSDBTask::class); //添加领取记录到ssdb $data = [ '620',1561, ]; $test = $ssdb->exec('multi_hset', SsdbKeysPrefix::PURCHASE_RECORD. date('Ymd') .'_620', $data); return $test; } }