feat : spu
This commit is contained in:
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Model;
|
||||
|
||||
use App\Constants\Common\CategoryCode;
|
||||
use App\Constants\Common\GoodCode;
|
||||
use Hyperf\Database\Model\Builder;
|
||||
use Hyperf\Database\Model\Collection;
|
||||
@@ -102,4 +103,17 @@ class Spu extends Model
|
||||
|
||||
return $res->toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $cycle_id
|
||||
* @return array
|
||||
*/
|
||||
public function getCycleIdAddStapleFoodSkuIds(int $cycle_id): array
|
||||
{
|
||||
return $this
|
||||
->leftJoin('sku','sku.spu_id','=','spu.id')
|
||||
->where('spu.cycle_id',$cycle_id)
|
||||
->where('spu.category_id',CategoryCode::EXTRA_STAPLE)->pluck('sku.id')
|
||||
->toArray();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user