12345678910111213141516171819202122232425262728293031323334353637 |
- <?php
- /**
- *
- *User:Administrator
- *Date:2021/10/14
- */
- namespace app\api\model;
- use think\Model;
- class Cyd extends Model
- {
- function production()
- {
- return $this->belongsTo('production', 'product_unit','id');
- }
- function unitsTest()
- {
- return $this->belongsTo('unitsTest', 'units_id', 'id');
- }
- public function selectSampleListByTaskIdAndUid($where,$pageNum=1,$pageSize=null)
- {
- $cyd = (new Cyd());
- $data = $cyd->with(['Production', 'UnitsTest'])->where($where)->page($pageNum,$pageSize)->select();
- return $data;
- }
- public function countSampleListByTaskIdAndUid($where)
- {
- $cyd = (new Cyd());
- $count = $cyd->with(['Production', 'UnitsTest'])->where($where)->count();
- return $count;
- }
- }
|