| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <?php
- declare(strict_types=1);
- namespace app\common\service;
- use app\common\model\Msg;
- /**
- * 消息服务
- */
- class SpecService extends BaseService{
-
- protected function init()
- {
-
- }
- //判断价格为空
- public static function getIsZeroSpecsPrice(array $data): bool
- {
- $result = false;
- foreach ($data as $item) {
- if(empty($item['price'])) return false;
- }
- return $result;
- }
- //获取规格列表
- public static function getSpecsList(int $type_id, array $data): array
- {
- $result = [];
- foreach ($data as $item) {
-
- if($item['type_id'] == $type_id){
- $result[] = $item;
- }
- }
- return $result;
- }
-
-
- }
|