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/Spec.php

36 lines
658 B
PHP
Raw Normal View History

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