1

parent 421fe5c9
<?php
namespace App\Http\Models\Order;
use Illuminate\Database\Eloquent\Model;
class CartModel extends Model
{
protected $primaryKey = 'cart_id';
public $timestamps = false;
//查询购物车数据
public static function getCartInfo($user_id)
{
$map = [
"user_id" => $user_id
];
$res = self::where($map)->first();
return ($res) ? $res->toArray() : [];
}
}
<?php
namespace App\Http\Models\Order;
use Illuminate\Database\Eloquent\Model;
class OrderModel extends Model
{
protected $table = 'order';
protected $primaryKey = 'order_id';
public $timestamps = false;
//添加购物车
public static function addCart()
{
}
//查询购物车数据
public static function getOrderInfoByrderSn($order_sn)
{
$map = [
"order_sn" => $order_sn
];
$res = self::where($map)->first();
return ($res) ? $res->toArray() : [];
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment