|
@@ -1,32 +0,0 @@
|
|
|
-<?php
|
|
|
-
|
|
|
-namespace app\data\model;
|
|
|
-
|
|
|
-use think\admin\Model;
|
|
|
-
|
|
|
-class ShopPurchaseMsg extends Model
|
|
|
-{
|
|
|
- public function target(){
|
|
|
- return $this->morphTo('target',[
|
|
|
- 'shop_purchase'=>ShopPurchase::class,
|
|
|
- 'shop_production'=>ShopProduction::class,
|
|
|
- 'shop_ocean'=>ShopOcean::class,
|
|
|
- 'shop_coordination'=>ShopCoordination::class,
|
|
|
- ]);
|
|
|
- }
|
|
|
- public function user(){
|
|
|
- return $this->belongsTo(DataUser::class,'user_id');
|
|
|
- }
|
|
|
- public function merchant(){
|
|
|
- return $this->belongsTo(SystemUser::class,'m_id');
|
|
|
- }
|
|
|
- public function makePos($user){
|
|
|
- if($user instanceof DataUser){
|
|
|
- return $this['is_mine']=$this['user_id']==$user['id'];
|
|
|
- }
|
|
|
- if($user instanceof SystemUser){
|
|
|
- return $this['is_mine']=$this['m_id']==$user['id'];
|
|
|
- }
|
|
|
- return false;
|
|
|
- }
|
|
|
-}
|