SendOrderLog.php 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <?php
  2. namespace common\models;
  3. use Yii;
  4. /**
  5. * This is the model class for table "{{%send_order_log}}".
  6. *
  7. * @property integer $id
  8. * @property integer $send_id
  9. * @property integer $uid
  10. * @property integer $c_time
  11. * @property integer $u_time
  12. * @property integer $handle
  13. * @property integer $status
  14. */
  15. class SendOrderLog extends \yii\db\ActiveRecord
  16. {
  17. /**
  18. * @inheritdoc
  19. */
  20. const HANDLE_YES = 10;
  21. const HANDLE_NO = 0;
  22. const STATUS_SEND = 1;//派单中
  23. const STATUS_WAIT_ROOM = 5;//待量房
  24. const STATUS_ALREADY_ROOM = 10;//已量房
  25. const STATUS_CONTRAST = 15;//对比中
  26. const STATUS_DEPOSIT = 20;//下定金
  27. const STATUS_CONTRACT = 25;//签合同
  28. const STATUS_BUILD = 30;//施工中
  29. const STATUS_COMPLETE = 35;//装修完成
  30. const STATUS_PASS = 40;//验收通过
  31. const STATUS_RUNNING = 45;//跑单
  32. const STATUS_END = 50;//结单
  33. const STATUS_CANCEL = -1;//取消
  34. /**
  35. * @return array
  36. * 状态数组
  37. */
  38. public static function status_list()
  39. {
  40. return [self::STATUS_SEND=>"派单中",self::STATUS_WAIT_ROOM=>"待量房",self::STATUS_ALREADY_ROOM=>"已量房",self::STATUS_CONTRAST=>"对比中",
  41. self::STATUS_DEPOSIT=>"下定金",self::STATUS_CONTRACT=>"签合同",self::STATUS_BUILD=>"施工中",self::STATUS_COMPLETE=>"装修完成",
  42. self::STATUS_PASS=>"验收通过",self::STATUS_RUNNING=>"跑单",self::STATUS_END=>"结单",self::STATUS_CANCEL=>"取消",];
  43. }
  44. public static function tableName()
  45. {
  46. return '{{%send_order_log}}';
  47. }
  48. /**
  49. * @inheritdoc
  50. */
  51. public function rules()
  52. {
  53. return [
  54. [['c_time','u_time'], 'default','value'=>time()],
  55. [['handle'], 'default','value'=>self::HANDLE_NO],
  56. [['status'], 'default','value'=>self::STATUS_SEND],
  57. [['send_id','uid','c_time','u_time','handle','status'], 'required'],
  58. [['send_id','uid','c_time','u_time','handle','status'], 'integer'],
  59. ];
  60. }
  61. /**
  62. * @inheritdoc
  63. */
  64. public function attributeLabels()
  65. {
  66. return [
  67. 'id' => 'ID',
  68. 'send_id' => '订单id',
  69. 'uid' => '装修公司id',
  70. 'c_time' => '创建时间',
  71. 'u_time' => '修改时间',
  72. 'handle' => '装修公司是否处理',
  73. 'status' => '状态',
  74. ];
  75. }
  76. public function getCompany()
  77. {
  78. return $this->hasOne(UserCompany::className(),['uid'=>'uid'])->select('uid,company');
  79. }
  80. public function getSendorder()
  81. {
  82. return $this->hasOne(SendOrder::className(),['id'=>'send_id']);
  83. }
  84. }