This repository has been archived on 2024-07-11. You can view files and clone it, but cannot push or open issues or pull requests.
yoshop/source/application/store/model/SpecValue.php

39 lines
789 B
PHP
Raw Normal View History

2020-04-25 22:20:29 +08:00
<?php
namespace app\store\model;
use app\common\model\SpecValue as SpecValueModel;
/**
* 规格/属性()模型
* Class SpecValue
* @package app\store\model
*/
class SpecValue extends SpecValueModel
{
/**
* 根据规格组名称查询规格id
* @param $spec_id
* @param $spec_value
* @return mixed
*/
public function getSpecValueIdByName($spec_id, $spec_value)
{
return self::where(compact('spec_id', 'spec_value'))->value('spec_value_id');
}
/**
* 新增规格值
* @param $spec_id
* @param $spec_value
* @return false|int
*/
public function add($spec_id, $spec_value)
{
$wxapp_id = self::$wxapp_id;
return $this->save(compact('spec_value', 'spec_id', 'wxapp_id'));
}
}