hasMany('TaxiOrder', 'order_idx') ->field('id,price'); } /** * @desc 实例化订单模型 * motor(摩的)、skill(技能)、mission(配送)、goods(商品) * * @param string $name * @return $class|\app\xxx\model\$name|\think\Model * @throws Exception * @author weichuanbao<654745815@qq.com> * @date 2022/1/4 0004 */ public static function ascription($name = '') { $class = '\\app\\common\\model\\'.ucwords($name).'\\Order'; if (class_exists($class)) { return model($class); } throw new Exception("Class $class is not exist"); } }