12345678910111213141516171819202122232425 |
- <?php
- namespace app\model;
- use think\Model;
- class CommunityBusiness extends Model
- {
- public function getRecordDateAttr($value){
- if ($value) {
- return date('Y-m-d', $value);
- }
- return '';
- }
- public function setRecordDateAttr($value){
- if ($value){
- return strtotime($value);
- }
- return 0;
- }
- public function communityName(){
- return $this->hasOne(Community::class, 'id', 'community_id')->bind(['community_name'=> 'name']);
- }
- }
|