ExternalConsultation.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | likeadmin快速开发前后端分离管理后台(PHP版)
  4. // +----------------------------------------------------------------------
  5. // | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
  6. // | 开源版本可自由商用,可去除界面版权logo
  7. // | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
  8. // | github下载:https://github.com/likeshop-github/likeadmin
  9. // | 访问官网:https://www.likeadmin.cn
  10. // | likeadmin团队 版权所有 拥有最终解释权
  11. // +----------------------------------------------------------------------
  12. // | author: likeadminTeam
  13. // +----------------------------------------------------------------------
  14. namespace app\common\model\external;
  15. use app\common\model\BaseModel;
  16. use app\common\model\goods\Goods;
  17. /**
  18. * ExternalConsultation模型
  19. * Class ExternalConsultation
  20. * @package app\common\model
  21. */
  22. class ExternalConsultation extends BaseModel
  23. {
  24. protected $name = 'external_consultation';
  25. public function goods()
  26. {
  27. return $this->hasOne(Goods::class, 'id', 'goods_id')
  28. ->field('id,goods_name,service_fee');
  29. }
  30. public function externalPlatform()
  31. {
  32. return $this->hasOne(ExternalPlatform::class, 'id', 'external_platform_id')
  33. ->field('id,name,tel');
  34. }
  35. public function customerLog()
  36. {
  37. return $this->hasMany(ExternalConsultationFollowLog::class,'consultation_id','id')->order(['id'=>'desc']);
  38. }
  39. public function customerOrder()
  40. {
  41. return $this->hasMany(ExternalConsultationOrder::class,'consultation_id','id')->order(['id'=>'desc']);
  42. }
  43. }