1
This commit is contained in:
@@ -7,6 +7,7 @@ namespace App\Model;
|
||||
|
||||
|
||||
use Hyperf\Database\Model\Collection;
|
||||
use Hyperf\Database\Model\Relations\HasOne;
|
||||
use Hyperf\DbConnection\Db;
|
||||
use Hyperf\Snowflake\Concern\Snowflake;
|
||||
|
||||
@@ -68,6 +69,14 @@ class PatientPathography extends Model
|
||||
|
||||
protected string $primaryKey = "pathography_id";
|
||||
|
||||
/**
|
||||
* 关联问诊订单表
|
||||
*/
|
||||
public function OrderInquiry(): HasOne
|
||||
{
|
||||
return $this->hasOne(OrderInquiry::class, 'order_inquiry_id', 'order_inquiry_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取信息-单条
|
||||
* @param array $params
|
||||
@@ -132,7 +141,8 @@ class PatientPathography extends Model
|
||||
*/
|
||||
public static function getPatientPathographyPage(array $params,array $fields = ["*"], int $page = null, ?int $per_page = 10): array
|
||||
{
|
||||
$result = self::where($params)
|
||||
$result = self::with(['OrderInquiry'])
|
||||
->where($params)
|
||||
->orderBy("created_at",'desc')
|
||||
->paginate($per_page, $fields, "page", $page);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user