| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <?php
- namespace app\common\model;
- use think\Exception;
- class OrderPaylog extends BaseModel
- {
- /**
- * @var string
- */
- protected $name = 'order_paylog';
- /**
- * @var array
- */
- protected $auto = [];
- /**
- * @var array
- */
- protected $insert = ['created_at','updated_at'];
- /**
- * @var array
- */
- protected $update = ['updated_at'];
- public function taxiOrder(): \think\model\relation\HasMany
- {
- return $this->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");
- }
- }
|