255], [['deliveryid', 'website', 'customer', 'receiptdate','delivery', 'origin_goodsinfo', 'goodsinfo', 'usage', 'mark'], 'string', 'max' => 255], ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => 'ID', 'deliveryid' => '收到单号', 'website' => '网站', 'customer' => '客户', 'delivery' => '货运', 'origin_goodsinfo' => '原订单货物详情', 'goodsinfo' => '货物详情', 'usage' => '完好程度', 'receiptdate' => '收货日期', 'num' => '当天序号', 'mark' => '备注', 'shop'=>'店铺' ]; } public function afterFind(){ parent::afterFind(); $this->receiptdate=date('Y-m-d',$this->receiptdate); } public function beforeValidate(){ is_array($this->imgs) && $this->imgs && $this->imgs = implode(',', $this->imgs); return $this; } public function beforeSave($options = array()){ parent::beforeSave($options); $this->receiptdate=strtotime(trim($this->receiptdate)); if(empty($this->created_at)){ $this->created_at=time(); } return $this; } }