EntrustList.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2017 https://www.sapixx.com All rights reserved.
  4. * @license Licensed (http://www.apache.org/licenses/LICENSE-2.0).
  5. * @author pillar<ltmn@qq.com>
  6. * 委托订单
  7. */
  8. namespace app\fastshop\model;
  9. use think\Model;
  10. class EntrustList extends Model{
  11. protected $pk = 'id';
  12. protected $table = 'ai_fastshop_entrust_list';
  13. /**
  14. * 商品基础库
  15. * @return void
  16. */
  17. public function item(){
  18. return $this->hasOne('Item','id','item_id');
  19. }
  20. /**
  21. * 所属用户信息
  22. * @return void
  23. */
  24. public function user(){
  25. return $this->hasOne('app\common\model\SystemUser','id','user_id');
  26. }
  27. /**
  28. * 状态数字变文字(前台)
  29. * @return void
  30. */
  31. public static function status($param){
  32. if($param->is_rebate){
  33. $status_text = '已成交';
  34. }else{
  35. if($param->is_under){
  36. $status_text = '未上架';
  37. }else{
  38. $status_text = '已上架';
  39. }
  40. }
  41. return $status_text;
  42. }
  43. }