1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
| <?php
|
| namespace app\agent\model\product;
|
| use app\common\model\product\SpecValue as SpecValueModel;
|
| /**
| * 规格/属性(值)模型
| */
| class SpecValue extends SpecValueModel
| {
|
| /**
| * 根据规格组名称查询规格id
| */
| public function getSpecValueIdByName($spec_id, $spec_value)
| {
| return self::where(compact('spec_id', 'spec_value'))->value('spec_value_id');
| }
|
| /**
| * 新增规格值
| */
| public function add($spec_id, $spec_value)
| {
| $agent_id = self::$agent_id;
| return $this->save(compact('spec_value', 'spec_id', 'agent_id'));
| }
|
| }
|
|