| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 | <?php/** * GmOrderModel.php UTF-8 * 玩家游戏币消费表 * * @date    : 2018/5/18 17:30 * * @license 这不是一个自由软件,未经授权不许任何使用和传播。 * @author  : wuyonghong <wyh@huosdk.com> * @version : HUOSDK 8.0 */namespace huo\model\finance;use huo\model\common\CommonModel;use huo\model\game\GameModel;class GmOrderModel extends CommonModel {    protected $name = 'gm_order';    // 开启自动写入时间戳字段    protected $autoWriteTimestamp = true;    public function mem() {        return $this->belongsTo('huo\model\member\MemberModel', 'mem_id', 'id')                    ->field('id,username,nickname,agent_id');    }    public function game() {        return $this->belongsTo(GameModel::className(), 'app_id', 'id');    }    /**     * 创建游戏币消费订单     * @param array $data     *     * @return bool|array     */    public function createOrder($data) {        $_data = $data;        if ($_obj = self::create($_data, true)) {            $_data['id'] = $_obj->id;            return $_data;        } else {            return false;        }    }}
 |