You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

49 lines
1.6 KiB

<?php
namespace App\Service;
use Hyperf\Di\Annotation\Inject;
use Hyperf\DbConnection\Db;
use App\Model\Goods;
use App\Model\Combination;
use App\Model\ShopCar;
use App\Constants\LogLabel;
use App\Commons\Log;
use Hyperf\Utils\ApplicationContext;
use App\TaskWorker\SSDBTask;
use App\Constants\SsdbKeysPrefix;
class PurchaseLimitService implements PurchaseLimitServiceInterface
{
public function getStoreIdByMarketId($params)
{
$res = [
'id' => 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($params)
{
$ssdb = ApplicationContext::getContainer()->get(SSDBTask::class);
$ssdb->exec('set', SsdbKeysPrefix::PURCHASE_RECORD. date('Ymd') .'_'.$params['user_id'].'_'.$params['good_id'], $params['order_id']);
$ssdb->exec('expire', SsdbKeysPrefix::PURCHASE_RECORD. date('Ymd') .'_'.$params['user_id'].'_'.$params['good_id'],60);
}
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;
}
}