小程序用户改用门店登录

This commit is contained in:
liu
2026-08-20 13:46:04 +08:00
parent 6d9f02d831
commit c1d490134e
251 changed files with 689 additions and 2727 deletions
+6 -6
View File
@@ -7,7 +7,7 @@ use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
/**
* 小程序购物车模型(门店订货车:按用户归属,同商品唯一行、加购合并数量)
* 小程序购物车模型(门店订货车:按门店归属,同商品唯一行、加购合并数量)
*/
class CartModel extends Model
{
@@ -17,23 +17,23 @@ class CartModel extends Model
protected $primaryKey = 'id';
protected $fillable = [
'user_id',
'store_id',
'product_id',
'quantity',
];
protected $casts = [
'user_id' => 'integer',
'store_id' => 'integer',
'product_id' => 'integer',
'quantity' => 'decimal:2',
];
/**
* 归属用户
* 归属门店
*/
public function user(): BelongsTo
public function store(): BelongsTo
{
return $this->belongsTo(UserModel::class, 'user_id', 'id');
return $this->belongsTo(StoreModel::class, 'store_id', 'id');
}
/**