1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <?php
- namespace app\common\model;
- /**
- * 医生导购信息表
- * Class DoctorGuideModel
- * @package app\common\model
- */
- class DoctorGuideModel extends BaseModel
- {
- protected $table = 'doctor_guide';
- public function getDoctorGuidePage($page,$pageSize,$condition=[],$is_count = false,$order=''){
- $join=[
- ['product product','product.product_no=doctor_guide.product_no','LEFT'],
- ['doctor doctor','doctor.doctor_no=doctor_guide.doctor_no','LEFT'],
- ];
- $this->alias('doctor_guide')
- ->field('doctor_guide.*,product.product_name,doctor.name doctor_name')
- ->join($join);
- if($condition){
- $this->where($condition);
- }
- if($is_count){
- return $this->count();
- }
- if($order){
- $this->order($order);
- }
- return $this->BaseModel($this->page($page,$pageSize)->select());
- }
- public function getDoctorGuideOne($condition=[]){
- $join=[
- ['product product','product.product_no=doctor_guide.product_no','LEFT'],
- ['doctor doctor','doctor.doctor_no=doctor_guide.doctor_no','LEFT'],
- ];
- $this->alias('doctor_guide')
- ->field('doctor_guide.*,product.product_name,doctor.name')
- ->join($join);
- if($condition){
- $this->where($condition);
- }
- return $this->BaseModel($this->find());
- }
- }
|