| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- <?php
- namespace App\Models;
- use DateTimeInterface;
- use Illuminate\Database\Eloquent\Factories\HasFactory;
- use Illuminate\Database\Eloquent\Model;
- /**
- * App\Models\Contract
- *
- * @mixin \Eloquent
- */
- class SignContract extends Model
- {
- use HasFactory;
- protected $guarded = ['id', 'updated_at', 'created_at'];
- /**
- * The table associated with the model.
- *
- * @var string
- */
- protected $table = 'sign_contracts';
- /**
- * 为数组 / JSON 序列化准备日期。
- *
- * @param \DateTimeInterface $date
- * @return string
- */
- protected function serializeDate(DateTimeInterface $date)
- {
- return $date->format($this->dateFormat ?: 'Y-m-d H:i:s');
- }
- private $statusEnum=[
- 0=>'文件生成中',
- 1=>'待签署',
- 2=>'已签署',
- 3=>'已撤销',
- 4=>'已拒签',
- 5=>'已过期',
- 7=>'已拒签',
- 10=>'签署失败',
- ];
- /**
- * 序列化数据字典
- */
- function initializeModel(){
- if($this->{'status'}!==null){
- $this->{'status_str'}=empty($this->statusEnum[$this->{'status'}])?'无':$this->statusEnum[$this->{'status'}];
- }
- }
- }
|