123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- <?php
- namespace common\models;
- use Yii;
- /**
- * This is the model class for table "{{%send_order}}".
- *
- * @property integer $id
- * @property string $name
- * @property string $tel
- * @property string $house_name
- * @property string $province
- * @property string $city
- * @property integer $budget
- * @property integer $source
- * @property string $remark
- * @property integer $status
- * @property integer $c_time
- */
- class SendOrder extends \yii\db\ActiveRecord
- {
- /**
- * @inheritdoc
- */
- const STATUS_YES = 10;//已派单
- const STATUS_NO = 1;//待派单
- const SOURCE_NET = 1 ;//网络订单
- const SOURCE_400 = 10 ;//400订单
- const SOURCE_LINE = 20 ;//线下订单
- const SOURCE_CHANNEL = 30 ;//渠道订单
- /**
- * @return array
- * 预算数组
- */
- public static function budget_list()
- {
- return [5=>"3万以下",10=>'3-8万',15=>"8-12万",20=>"12-30万",25=>"30-50万",30=>"50万以上",35=>"具体面议"];
- }
- /**
- * @return array
- * 订单来源数组
- */
- public static function source_list()
- {
- return [self::SOURCE_NET=>"网络订单",self::SOURCE_400=>'400订单',self::SOURCE_LINE=>"线下订单",self::SOURCE_CHANNEL=>"渠道订单"];
- }
- /**
- * @return array
- * 状态数组
- */
- public static function status_list()
- {
- return [self::STATUS_NO=>"待派单",self::STATUS_YES=>'已派单'];
- }
- public static function tableName()
- {
- return '{{%send_order}}';
- }
- /**
- * @inheritdoc
- */
- public function rules()
- {
- return [
- [['c_time'], 'default','value'=>time()],
- [['status'], 'default','value'=>self::STATUS_NO],
- [['name','tel','house_name','province','city','budget','source','status','c_time'], 'required'],
- [['name','tel','house_name'], 'string','max' => 32],
- [['remark'], 'string'],
- [['c_time', 'budget','status','source'], 'integer'],
- ];
- }
- /**
- * @inheritdoc
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'name' => '业主姓名',
- 'tel' => '电话号码',
- 'house_name' => '小区名称',
- 'province' => '省编号',
- 'city' => '市编号',
- 'budget' => '预算',
- 'source' => '来源',
- 'remark' => '备注',
- 'status' => '状态',
- 'c_time' => '创建时间',
- ];
- }
- }
|