GoodsAdd.php 533 B

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