'id', 'delivery_id' => '物流id', 'order_goods_id' => '订单商品id', 'goods_id' => '商品id', 'goods_name' => '商品名称', 'goods_count' => '商品数量', 'created_at' => '创建时间', 'updated_at' => '更新时间', ]; } /** * @author linyao * @email 602604991@qq.com * @created Nov 8, 2019 * * 行为存储创建时间和更新时间 */ public function behaviors() { return [ [ 'class' => TimestampBehavior::className(), 'createdAtAttribute' => 'created_at', 'updatedAtAttribute' => 'updated_at', 'value' => function() { return time(); }, ], ]; } public function getGoods() { return $this->hasOne(Goods::className(), ['id' => 'goods_id']); } public function getOrderGoods() { return $this->hasOne(OrderGoods::className(), ['id' => 'order_goods_id']); } }