100], [['car_no','engine_no','pay_no','insurer1_no','insurer2_no','identifying_code','money_man','insurer_non_no'], 'string', 'max' => 50], [['remark'], 'string', 'max' => 200], ]; } /** * @inheritdoc */ public function attributeLabels() { return [ 'id' => 'ID', 'car_id' => 'Car ID', 'user_id' => 'User ID', 'car_no' => 'Car No', 'engine_no' => 'Engine No', 'car_frame_no' => 'Car Frame No', 'car_man' => 'Car Man', 'gift_other' => 'Gift Other', 'company_id' => 'Company ID', 'company2_id' => 'Company2 ID', 'status_id' => 'Status ID', 'submit_date' => 'Submit Date', 'id_man' => 'Id Man', 'id_number' => 'Id Number', 'link_man' => 'Link Man', 'insurer1_begin_date' => 'Insurer1 Begin Date', 'insurer1_end_date' => 'Insurer1 End Date', 'insurer2_begin_date' => 'Insurer2 Begin Date', 'insurer2_end_date' => 'Insurer2 End Date', 'send_date' => 'Send Date', 'direction_id' => 'Direction 1 ID', 'range1_id' => 'Range 1 ID', 'city1_id' => 'City 1 ID', 'district1_id' => 'District 1 ID', 'send_address1' => 'Send Address 1', 'direction2_id' => 'Direction 2 ID', 'range2_id' => 'Range 2 ID', 'city2_id' => 'City 2 ID', 'district2_id' => 'District 2 ID', 'send_address2' => 'Send Address 2', 'pay_type_id' => 'Pay Type ID', 'pay_no' => 'Pay No', 'remark' => 'Remark', 'total1' => 'Total 1', 'total1_clear' => 'Total 1 Clear', 'total1_real' => 'Total 1 Real', 'total1_dis' => 'Total 1 Dis', 'total1_percent' => 'Total 1 Percent', 'total1_rate' => 'Total 1 Rate', 'total2' => 'Total 2', 'total2_clear' => 'Total 2 Clear', 'total2_rate' => 'Total 2 Rate', 'total3' => 'Total 3', 'total_all' => 'Total all', 'total_real' => 'Total Real', 'price_remark' => 'Price Remark', 'lock_id' => 'Lock ID', 'insurer1_no' => 'Insurer 1 No', 'insurer2_no' => 'Insurer 2 No', 'identifying_code' => 'Identifying Code', 'money_man' => 'Money Man', 'money_no' => 'Money No', 'money_bank' => 'Money Bank', 'email' => 'email', 'success_id' => 'Success ID', 'return_status_id' => 'Return Status ID', 'return_time' => 'Return Time', 'return_remark' => 'Return Remark', 'print_date' => 'Print Date', 'piao_header' => 'Piao Header', 'first_send' => 'First Send', 'send_times' => 'Send Times', 'check_gift' => 'Check Gift', 'tijiang' => 'Ti Jiang', 'gift_type1_id' => 'Gift Type1 ID', 'gift_type2_id' => 'Gift Type2 ID', 'gift_type3_id' => 'Gift Type3 ID', 'gift_type4_id' => 'Gift Type4 ID', 'gift_type5_id' => 'Gift Type5 ID', 'gift_type6_id' => 'Gift Type6 ID', 'gift_type7_id' => 'Gift Type7 ID', 'gift_type8_id' => 'Gift Type8 ID', 'created_at' => 'Created At', 'updated_at' => 'Updated At', 'photo_face' => 'Photo Face', 'photo_back' => 'Photo Back', 'business_group_id' => 'Business Group Id', 'op1_id' => 'Op 1 ID', 'op2_id' => 'Op 2 ID' ]; } public function getUser() { return $this->hasOne(UserT::className(),['id'=>'user_id']); } public function getAddr() { return $this->hasOne(OrderAddress::className(),['id'=>'addr_id']); } public function getPayee() { return $this->hasOne(PayeeT::className(),['id'=>'payee_id']); } public function getPayment() { return $this->hasOne(Payment::className(),['id'=>'payment_id']); } public function getLock() { return $this->hasOne(UserT::className(),['id'=>'lock_id']); } public function getSuccess() { return $this->hasOne(InvalidT::className(),['id'=>'success_id']); } public function getPayType() { return $this->hasOne(PayTypeT::className(),['id'=>'pay_type_id']); } public function getCar() { return $this->hasOne(CarT::className(),['id'=>'car_id']); } public function getStatus() { return $this->hasOne(StatusT::className(),['id'=>'status_id']); } public function getCompany() { return $this->hasOne(InsurerCompanyT::className(),['id'=>'company_id']); } public function getCompany2() { return $this->hasOne(InsurerCompany2T::className(),['id'=>'company2_id']); } public function getPrices() { return $this->hasMany(PriceT::className(),['order_id'=>'id']); } public function getRange1() { return $this->hasOne(RangeT::className(),['id'=>'range1_id']); } public function getSendCity() { return $this->hasOne(CityT::className(),['id'=>'send_city_id']); } public function getSendDistrict() { return $this->hasOne(DistrictT::className(),['id'=>'send_district_id']); } public function getRange2() { return $this->hasOne(RangeT::className(),['id'=>'range2_id']); } public function getDirection2() { return $this->hasOne(DirectionT::className(),['id'=>'direction2_id']); } public function getCity2() { return $this->hasOne(CityT::className(),['id'=>'city2_id']); } public function getDistrict2() { return $this->hasOne(DistrictT::className(),['id'=>'district2_id']); } public function getGifts() { return $this->hasMany(GiftT::className(),['id'=>'gift_id']) ->viaTable('car_gift_t',['order_id'=>'id']); } public function getGiftType1() { return $this->hasOne(GiftType2T::className(),['id'=>'gift_type1_id']); } public function getGiftType2() { return $this->hasOne(GiftType2T::className(),['id'=>'gift_type2_id']); } public function getGiftType3() { return $this->hasOne(GiftType2T::className(),['id'=>'gift_type3_id']); } public function getGiftType4() { return $this->hasOne(GiftType2T::className(),['id'=>'gift_type4_id']); } public function getGiftType5() { return $this->hasOne(GiftType2T::className(),['id'=>'gift_type5_id']); } public function getGiftType6() { return $this->hasOne(GiftType2T::className(),['id'=>'gift_type6_id']); } public function getGiftType7() { return $this->hasOne(GiftType2T::className(),['id'=>'gift_type7_id']); } public function getGiftType8() { return $this->hasOne(GiftType2T::className(),['id'=>'gift_type8_id']); } public function getCaiwu() { return $this->hasOne(OrderCaiwuT::className(),['order_id'=>'id']); } public function getCaiwu1() { return $this->hasOne(OrderCaiwuT1::className(),['order_id'=>'id']); } public function getSendLog() { return $this->hasOne(SendLogT::className(),['order_id'=>'id']); } public function getOrderGifts() { return $this->hasMany(OrderGiftT::className(),['order_id'=>'id']); } public function getGiftPrice($is_free,$gift_type) { $order_gifts = OrderGiftT::find() ->where('order_id='.$this->id.' and is_free='.$is_free.' and gift_type='.$gift_type) ->all(); $price = 0; foreach($order_gifts as $order_gift) { $price += $order_gift->price; } return $price; } public function getUsers() { return $this->hasMany(OrderUserT::class,['order_id'=>'id']); } /** * 获取业务分组 * 2017-12-20 * xzz */ public function getBusinessGroup() { return $this->hasOne(BusinessGroupT::className(), ['id' => 'business_group_id']); } public function getOp1() { return $this->hasOne(UserT::className(),['id'=>'op1_id']); } public function getOp2() { return $this->hasOne(UserT::className(),['id'=>'op2_id']); } public function getNona() { return $this->hasOne(Scheme::className(),['id'=>'ord_scheme_id']); } }