1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- <?php
- namespace common\models;
- use Yii;
- /**
- * This is the model class for table "{{%send_order_log}}".
- *
- * @property integer $id
- * @property integer $send_id
- * @property integer $uid
- * @property integer $c_time
- * @property integer $u_time
- * @property integer $handle
- * @property integer $status
- */
- class SendOrderLog extends \yii\db\ActiveRecord
- {
- /**
- * @inheritdoc
- */
- const HANDLE_YES = 10;
- const HANDLE_NO = 0;
- const STATUS_SEND = 1;//派单中
- const STATUS_WAIT_ROOM = 5;//待量房
- const STATUS_ALREADY_ROOM = 10;//已量房
- const STATUS_CONTRAST = 15;//对比中
- const STATUS_DEPOSIT = 20;//下定金
- const STATUS_CONTRACT = 25;//签合同
- const STATUS_BUILD = 30;//施工中
- const STATUS_COMPLETE = 35;//装修完成
- const STATUS_PASS = 40;//验收通过
- const STATUS_RUNNING = 45;//跑单
- const STATUS_END = 50;//结单
- const STATUS_CANCEL = -1;//取消
- /**
- * @return array
- * 状态数组
- */
- public static function status_list()
- {
- return [self::STATUS_SEND=>"派单中",self::STATUS_WAIT_ROOM=>"待量房",self::STATUS_ALREADY_ROOM=>"已量房",self::STATUS_CONTRAST=>"对比中",
- self::STATUS_DEPOSIT=>"下定金",self::STATUS_CONTRACT=>"签合同",self::STATUS_BUILD=>"施工中",self::STATUS_COMPLETE=>"装修完成",
- self::STATUS_PASS=>"验收通过",self::STATUS_RUNNING=>"跑单",self::STATUS_END=>"结单",self::STATUS_CANCEL=>"取消",];
- }
- public static function tableName()
- {
- return '{{%send_order_log}}';
- }
- /**
- * @inheritdoc
- */
- public function rules()
- {
- return [
- [['c_time','u_time'], 'default','value'=>time()],
- [['handle'], 'default','value'=>self::HANDLE_NO],
- [['status'], 'default','value'=>self::STATUS_SEND],
- [['send_id','uid','c_time','u_time','handle','status'], 'required'],
- [['send_id','uid','c_time','u_time','handle','status'], 'integer'],
- ];
- }
- /**
- * @inheritdoc
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'send_id' => '订单id',
- 'uid' => '装修公司id',
- 'c_time' => '创建时间',
- 'u_time' => '修改时间',
- 'handle' => '装修公司是否处理',
- 'status' => '状态',
- ];
- }
- public function getCompany()
- {
- return $this->hasOne(UserCompany::className(),['uid'=>'uid'])->select('uid,company');
- }
- public function getSendorder()
- {
- return $this->hasOne(SendOrder::className(),['id'=>'send_id']);
- }
- }
|