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.
39 lines
915 B
39 lines
915 B
<?php
|
|
|
|
namespace App\Service\v3\Implementations;
|
|
|
|
use App\Constants\v3\ActivityType;
|
|
use App\Model\v3\GoodsActivity;
|
|
use App\Service\v3\Interfaces\ActivityServiceInterface;
|
|
|
|
class ActivityService implements ActivityServiceInterface
|
|
{
|
|
|
|
public function do()
|
|
{
|
|
// TODO: Implement do() method.
|
|
}
|
|
|
|
public function check()
|
|
{
|
|
// TODO: Implement check() method.
|
|
}
|
|
|
|
public function undo()
|
|
{
|
|
// TODO: Implement undo() method.
|
|
}
|
|
|
|
public function allForAppletIndex($type, $marketId)
|
|
{
|
|
$builder = GoodsActivity::query()
|
|
->with(['store'])
|
|
->where(['type' => $type])
|
|
->where(function ($query) use ($marketId) {
|
|
$query->whereJsonContains("market_ids", [(string)$marketId])
|
|
->orWhereJsonLength("market_ids", '=', 0);
|
|
});
|
|
|
|
return $builder->get()->toArray();
|
|
}
|
|
}
|