| 1234567891011121314151617181920212223242526272829303132 |
- <?php
- declare(strict_types=1);
- namespace app\common\model;
- use think\Model;
- //风速-发货记录
- class FengsuSku Extends Model
- {
- // 自动写入时间戳字段
- protected $autoWriteTimestamp = true;
- protected $createTime = 'createtime';
- protected $updateTime = 'updatetime';
- protected $type = [
- 'createtime' => 'timestamp:Y-m-d H:i',
- 'updatetime' => 'timestamp:Y-m-d H:i',
- ];
- public function stockconfig()
- {
- return $this->hasOne(StockConfig::class,'id','variety_id')->field('id,title');
- }
-
- //获取店铺下规格
- public static function getSpecsIdByShopId(string $shop_id, string $spec_id): object
- {
- return self::where('shop_id', $shop_id)->where('sku_id', $spec_id)->findOrEmpty();
- }
- }
|