12345678910111213141516171819202122232425262728 |
- <?php
- /**
- * Author: luzheng.liu
- * Time: 2021/4/1 14:34
- */
- namespace app\api\model;
- use app\common\until\Until;
- class CartModel extends BaseModel {
- const NORMAL = 1;
- protected $table = 'cart';
- public function getCartList() {
- $rs = $this->alias('c')
- ->field('cp.product_id,cp.num,p.product_name,p.current_price')
- ->join('cart_product cp', 'cp.cart_id = c.id')
- ->join('product p','p.id = cp.product_id')
- ->where($this->getWhere())
- ->select();
- return Until::modelToArray($rs);
- }
- }
|