1234567891011121314151617181920212223 |
- <?php
- namespace app\index\model;
- class BuyCarModel extends BaseModel
- {
- protected $table='buy_car';
- protected $connection = 'db_mall';
- /**
- * 购物车表联合产品表
- * @param $condition
- * @param $order
- * @return false|\PDOStatement|string|\think\Collection
- */
- public function getCarAndProductInfo($condition,$order='pro.category_id asc'){
- $list = $this->join('product pro','pro.product_id = buy_car.product_id','LEFT')
- ->field("buy_car.num as num,buy_car.id as buy_car_id,pro.*")
- ->where($condition)->order($order)->select();
- return $list;
- }
- }
|