12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- <?php
- /**
- * Created by PhpStorm.
- * User: zilongs
- * Date: 20-9-30
- * Time: 下午10:56
- */
- namespace App\Models;
- class Order extends BaseModel
- {
- CONST UNPAID = 1, ISING = 2, FINISHED = 3,CANCELED=4; //订单状态(1.未支付 2.进行中 3.已完成 4.已取消)
- public static $_order_status = [
- self::UNPAID=>'未支付',
- self::ISING=>'进行中',
- self::FINISHED=>'已完成',
- self::CANCELED=>'已取消',
- ];
- //获取订单状态
- public function getStatus()
- {
- return self::$_order_status;
- }
- public function docter()
- {
- return $this->belongsTo(Docter::class);
- }
- public function orderPatient()
- {
- return $this->hasOne(OrderPatient::class);
- }
- public function orderPack()
- {
- return $this->hasMany(OrderPack::class);
- }
- public function orderNurse()
- {
- return $this->hasMany(OrderNurse::class);
- }
- public function orderVaccine()
- {
- return $this->hasOne(OrderVaccine::class);
- }
- public function orderUser()
- {
- return $this->hasOne(User::class,'id','user_id');
- }
- public function organization()
- {
- return $this->belongsTo(Organization::class);
- }
- }
|