Browse Source

Merge branch 'phoenix' of http://120.24.33.109:11081/hyzjshwo/lanzu_api_hyperf into phoenix

master
Lemon 5 years ago
parent
commit
d21ec37f80
  1. 32
      app/Listener/LanzuServerStartListener.php
  2. 2
      app/Model/v3/Goods.php
  3. 2
      app/Model/v3/GoodsActivity.php
  4. 8
      app/Model/v3/Store.php
  5. 1
      config/autoload/listeners.php

32
app/Listener/LanzuServerStartListener.php

@ -0,0 +1,32 @@
<?php
declare(strict_types=1);
/**
* This file is part of Hyperf.
*
* @link https://www.hyperf.io
* @document https://doc.hyperf.io
* @contact group@hyperf.io
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/
namespace App\Listener;
use Hyperf\Event\Contract\ListenerInterface;
use Hyperf\Framework\Event\MainWorkerStart;
class LanzuServerStartListener implements ListenerInterface
{
public function listen(): array
{
return [
MainWorkerStart::class,
];
}
public function process(object $event)
{
//平滑更新
//var_dump("process:\n");
}
}

2
app/Model/v3/Goods.php

@ -96,7 +96,7 @@ class Goods extends Model
public function getMonthSalesAttribute()
{
$ssdb = ApplicationContext::getContainer()->get(SSDBTask::class);
return (integer)$ssdb->exec('get', SsdbKeys::GOODS_MONTH_SALES.date('Ym').'_'.$this->id);
return (integer)$ssdb->exec('get', SsdbKeys::GOODS_MONTH_SALES.date('Ym').'_1_'.$this->id);
}
public function getCartNumAttribute()

2
app/Model/v3/GoodsActivity.php

@ -64,7 +64,7 @@ class GoodsActivity extends Model
public function getMonthSalesAttribute()
{
$ssdb = ApplicationContext::getContainer()->get(SSDBTask::class);
return (integer)$ssdb->exec('get', SsdbKeys::GOODS_MONTH_SALES.date('Ym').'_'.$this->id);
return (integer)$ssdb->exec('get', SsdbKeys::GOODS_MONTH_SALES.date('Ym').'_2_'.$this->id);
}
public function getCartNumAttribute()

8
app/Model/v3/Store.php

@ -72,10 +72,10 @@ class Store extends Model
return (integer)$ssdb->exec('get', SsdbKeys::STORE_MONTH_SALES.date('Ym').'_'.$this->id);
}
public function getLogoAttribute($value)
{
return $this->attachmentService->switchImgToAliOss($value, OssThumbnail::THUMBNAIL_300_Q80);
}
// public function getLogoAttribute($value)
// {
// return $this->attachmentService->switchImgToAliOss($value, OssThumbnail::THUMBNAIL_300_Q80);
// }
public function goods()
{

1
config/autoload/listeners.php

@ -11,4 +11,5 @@ declare(strict_types=1);
*/
return [
\App\Listener\ValidatorFactoryResolvedListener::class,
\App\Listener\LanzuServerStartListener::class,
];
Loading…
Cancel
Save