GoodsSku.php 543 B

1234567891011121314151617181920212223
  1. <?php
  2. namespace app\api\model\service;
  3. use think\Model;
  4. class GoodsSku extends Model
  5. {
  6. // 表名
  7. protected $name = 'service_goods_sku';
  8. // 自动写入时间戳字段
  9. protected $autoWriteTimestamp = 'int';
  10. // 定义时间戳字段名
  11. protected $createTime = 'createtime';
  12. protected $updateTime = 'updatetime';
  13. public static function getSkuList($goods_id)
  14. {
  15. return self::where(['goods_id'=>$goods_id,'status'=>'normal'])->field('id,name,price,salenums')->select();
  16. }
  17. }