SupplierContact.php 1.3 KB

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. /**
  3. +-----------------------------------------------------------------------------------------------
  4. * GouGuOPEN [ 左手研发,右手开源,未来可期!]
  5. +-----------------------------------------------------------------------------------------------
  6. * @Copyright (c) 2021~2024 http://www.gouguoa.com All rights reserved.
  7. +-----------------------------------------------------------------------------------------------
  8. * @Licensed 勾股OA,开源且可免费使用,但并不是自由软件,未经授权许可不能去除勾股OA的相关版权信息
  9. +-----------------------------------------------------------------------------------------------
  10. * @Author 勾股工作室 <hdm58@qq.com>
  11. +-----------------------------------------------------------------------------------------------
  12. */
  13. namespace app\contract\model;
  14. use think\facade\Db;
  15. use think\Model;
  16. class SupplierContact extends Model
  17. {
  18. // 获取详情
  19. public function detail($id)
  20. {
  21. $detail = Db::name('SupplierContact')->where(['id' => $id])->find();
  22. if (!empty($detail)) {
  23. $detail['create_time'] = date('Y-m-d H:i:s', $detail['create_time']);
  24. $detail['supplier'] = Db::name('Supplier')->where(['id' => $detail['sid']])->value('title');
  25. }
  26. return $detail;
  27. }
  28. }