1234567891011121314151617181920212223242526 |
- <?php
- namespace App\Models;
- use Illuminate\Database\Eloquent\Factories\HasFactory;
- use Illuminate\Database\Eloquent\Model;
- class Goods extends Model
- {
- use HasFactory;
- protected $table = 'goods';
- public $timestamps = false;
- protected static $unguarded = true;
- /**
- * 根据商品id获取商品
- * */
- public static function getGoodsListByItemIds($itemIds)
- {
- return self::selectRaw("item_id, short_title as item_short_title, coupon_amount as coupon_money, coupon_end_time, reserve_price, zk_final_price, pict_url as item_pic, title as item_title")
- ->where('enable', 1)->whereIn('item_id', $itemIds)
- ->get();
- }
- }
|