1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- <?php
- namespace app\common\model;
- /**
- * 售后订单管理
- * Class GoodsTypeModel
- * @package app\common\model
- */
- class OrderSalesModel extends BaseModel
- {
- protected $table = 'order_sales';
- //后台订单分页
- public function getOrderSalesPage($page,$pageSize,$condition=[],$is_count = false,$order=''){
- $join=[
- ['order order','order.order_no=orderSales.order_no','LEFT'],
- ];
- $this->alias('orderSales')
- ->field('orderSales.*')
- ->join($join);
- if($condition){
- $this->where($condition);
- }
- if($is_count){
- return $this->count();
- }
- if($order){
- $this->order($order);
- }
- return $this->page($page,$pageSize)->select();
- }
- public function getOrderSalesOne($condition=[]){
- $join=[
- ['pay_list pay_list','pay_list.order_no=orderSales.order_no','LEFT'],
- ];
- $this->alias('orderSales')
- ->field('orderSales.*,pay_list.wx_price,pay_list.pay_no')
- ->join($join);
- if($condition){
- $this->where($condition);
- }
- return $this->find();
- }
- // 获取售后订单
- public function getOrderSales($condition=[]){
- $join=[
- // ['order order','order.order_no=sales.order_no','LEFT'],
- ];
- $this->alias('sales')
- ->field('sales.*')
- ->join($join);
- if($condition){
- $this->where($condition);
- }
- return $this->BaseModel($this->find());
- }
- }
|