api/app/model/Carts.php
2021-01-04 13:45:02 +08:00

29 lines
578 B
PHP

<?php
declare (strict_types = 1);
namespace app\model;
use app\BaseModel;
use think\facade\Db;
/**
* @mixin \think\Model
* @property float $add_price
* @property int $uid
* @property int $goods_id
* @property int $count
*/
class Carts extends BaseModel
{
//
public function queryByUid(int $uid)
{
return Db::table($this->getTable())
->alias('c')
->join('goods g','c.goods_id = g.id')
->field('c.*,g.title,g.sell_price,g.picture,g.category,g.stock')
->where('uid',$uid)
->select();
}
}