Commit 176aa1a6 by biao Committed by lixq

1

Signed-off-by: lixq's avatarLixiaoqiang <276402404@qq.com>
parent 5fa6a03c
...@@ -31,6 +31,27 @@ Create INDEX government_mst_city_idx ON government_mst(city); ...@@ -31,6 +31,27 @@ Create INDEX government_mst_city_idx ON government_mst(city);
Create INDEX government_mst_district_idx ON government_mst(district); Create INDEX government_mst_district_idx ON government_mst(district);
##----government_qr_dat create
DROP TABLE IF EXISTS government_qr_dat;
CREATE TABLE IF NOT EXISTS government_qr_dat(
id bigint unsigned NOT NULL PRIMARY KEY auto_increment,
registration_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
government_id int8 NOT NULL,
province varchar(64) NOT NULL,
city varchar(64),
district varchar(64),
max_count int8 NOT NULL DEFAULT '0',
limit_date timestamp NOT NULL,
title text NOT NULL,
delete_flg tinyint(1) NOT NULL DEFAULT '0'
) ENGINE = INNODB DEFAULT CHARSET=utf8mb4;
Create INDEX government_qr_dat_province_idx ON government_qr_dat(province);
Create INDEX government_qr_dat_city_idx ON government_qr_dat(city);
Create INDEX government_qr_dat_district_idx ON government_qr_dat(district);
##----account_mst create ##----account_mst create
DROP TABLE IF EXISTS account_mst; DROP TABLE IF EXISTS account_mst;
...@@ -131,6 +152,7 @@ CREATE TABLE IF NOT EXISTS circle_dat( ...@@ -131,6 +152,7 @@ CREATE TABLE IF NOT EXISTS circle_dat(
comment text NOT NULL, comment text NOT NULL,
longitude text NOT NULL, longitude text NOT NULL,
latitude text NOT NULL DEFAULT 'UNKNOW', latitude text NOT NULL DEFAULT 'UNKNOW',
address text NOT NULL,
owner_id int8 NOT NULL DEFAULT '0', owner_id int8 NOT NULL DEFAULT '0',
delete_flg tinyint(1) NOT NULL DEFAULT '0' delete_flg tinyint(1) NOT NULL DEFAULT '0'
) ENGINE = INNODB DEFAULT CHARSET=utf8mb4; ) ENGINE = INNODB DEFAULT CHARSET=utf8mb4;
...@@ -157,16 +179,16 @@ DROP TABLE IF EXISTS user_mst; ...@@ -157,16 +179,16 @@ DROP TABLE IF EXISTS user_mst;
CREATE TABLE IF NOT EXISTS user_mst( CREATE TABLE IF NOT EXISTS user_mst(
id bigint unsigned NOT NULL PRIMARY KEY auto_increment, id bigint unsigned NOT NULL PRIMARY KEY auto_increment,
registration_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, registration_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
school_id int8 NOT NULL DEFAULT '0', school_no text NOT NULL DEFAULT '0',
class_id int8 NOT NULL DEFAULT '0', class_no text NOT NULL DEFAULT '0',
name varchar(64) NOT NULL, original_source int8 NOT NULL DEFAULT '0',
tel_no varchar(32) NOT NULL, openid varchar(64) NOT NULL DEFAULT 'UNKNOW',
unionid varchar(64) NOT NULL DEFAULT 'UNKNOW', unionid varchar(64) NOT NULL DEFAULT 'UNKNOW',
status varchar(64) NOT NULL DEFAULT '0', name varchar(64),
mobile varchar(32),
account_id int8 NOT NULL DEFAULT '0', account_id int8 NOT NULL DEFAULT '0',
child_age int8, child_age int8 NOT NULL DEFAULT '1',
role varchar(128) NOT NULL DEFAULT '0', role varchar(128) NOT NULL DEFAULT '0',
point int8 NOT NULL DEFAULT '0',
longitude text NOT NULL, longitude text NOT NULL,
latitude text NOT NULL DEFAULT 'UNKNOW', latitude text NOT NULL DEFAULT 'UNKNOW',
organization_submit_date timestamp, organization_submit_date timestamp,
...@@ -184,9 +206,6 @@ CREATE TABLE IF NOT EXISTS user_mst( ...@@ -184,9 +206,6 @@ CREATE TABLE IF NOT EXISTS user_mst(
delete_flg tinyint(1) NOT NULL DEFAULT '0' delete_flg tinyint(1) NOT NULL DEFAULT '0'
) ENGINE = INNODB DEFAULT CHARSET=utf8mb4; ) ENGINE = INNODB DEFAULT CHARSET=utf8mb4;
Create INDEX user_mst_school_id_idx ON user_mst(school_id);
Create INDEX user_mst_class_id_idx ON user_mst(class_id);
Create INDEX user_mst_tel_no_idx ON user_mst(tel_no);
##----social_event_dat create ##----social_event_dat create
...@@ -313,6 +332,25 @@ CREATE TABLE IF NOT EXISTS volunteer_event_member_dat( ...@@ -313,6 +332,25 @@ CREATE TABLE IF NOT EXISTS volunteer_event_member_dat(
Create INDEX volunteer_event_member_dat_user_id_idx ON volunteer_event_member_dat(user_id(255)); Create INDEX volunteer_event_member_dat_user_id_idx ON volunteer_event_member_dat(user_id(255));
##----user_certificate_dat create
DROP TABLE IF EXISTS user_certificate_dat;
CREATE TABLE IF NOT EXISTS user_certificate_dat(
id bigint unsigned NOT NULL PRIMARY KEY auto_increment,
registration_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
user_id text NOT NULL,
certificate_id text NOT NULL,
name varchar(64) NOT NULL,
mobile varchar(32) NOT NULL,
address varchar(128) NOT NULL,
status varchar(64) NOT NULL DEFAULT '0',
delete_flg tinyint(1) NOT NULL DEFAULT '0'
) ENGINE = INNODB DEFAULT CHARSET=utf8mb4;
Create INDEX user_certificate_dat_user_id_idx ON user_certificate_dat(user_id(255));
Create INDEX user_certificate_dat_certificate_id_idx ON user_certificate_dat(certificate_id(255));
##----certificate_mst create ##----certificate_mst create
DROP TABLE IF EXISTS certificate_mst; DROP TABLE IF EXISTS certificate_mst;
...@@ -343,3 +381,70 @@ CREATE TABLE IF NOT EXISTS user_point_log( ...@@ -343,3 +381,70 @@ CREATE TABLE IF NOT EXISTS user_point_log(
Create INDEX user_point_log_user_id_idx ON user_point_log(user_id); Create INDEX user_point_log_user_id_idx ON user_point_log(user_id);
##----course_media_dat create
DROP TABLE IF EXISTS course_media_dat;
CREATE TABLE IF NOT EXISTS course_media_dat(
id bigint unsigned NOT NULL PRIMARY KEY auto_increment,
registration_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
course_id int8 NOT NULL DEFAULT '0',
title varchar(128) NOT NULL,
tags text NOT NULL,
front_image varchar(64) NOT NULL,
media text NOT NULL,
teacher varchar(128),
is_free tinyint(1) NOT NULL DEFAULT '0',
price float(5,2) NOT NULL DEFAULT '0',
view_count int8 NOT NULL DEFAULT '0',
delete_flg tinyint(1) NOT NULL DEFAULT '0'
) ENGINE = INNODB DEFAULT CHARSET=utf8mb4;
Create INDEX course_media_dat_course_id_idx ON course_media_dat(course_id);
##----media_tag_dat create
DROP TABLE IF EXISTS media_tag_dat;
CREATE TABLE IF NOT EXISTS media_tag_dat(
id bigint unsigned NOT NULL PRIMARY KEY auto_increment,
registration_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
tag varchar(128) NOT NULL,
delete_flg tinyint(1) NOT NULL DEFAULT '0'
) ENGINE = INNODB DEFAULT CHARSET=utf8mb4;
Create INDEX media_tag_dat_tag_idx ON media_tag_dat(tag);
##----course_mst create
DROP TABLE IF EXISTS course_mst;
CREATE TABLE IF NOT EXISTS course_mst(
id bigint unsigned NOT NULL PRIMARY KEY auto_increment,
registration_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
title varchar(128) NOT NULL,
front_image varchar(64) NOT NULL,
teacher_profile text,
delete_flg tinyint(1) NOT NULL DEFAULT '0'
) ENGINE = INNODB DEFAULT CHARSET=utf8mb4;
##----user_point_log create
DROP TABLE IF EXISTS user_point_log;
CREATE TABLE IF NOT EXISTS user_point_log(
id bigint unsigned NOT NULL PRIMARY KEY auto_increment,
registration_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
user_id int8 NOT NULL,
media_id int8 NOT NULL,
is_free tinyint(1) NOT NULL DEFAULT '0',
money float(5,2) NOT NULL DEFAULT '0',
order_no varchar(255),
mchid_order_no varchar(255),
status varchar(64),
delete_flg tinyint(1) NOT NULL DEFAULT '0'
) ENGINE = INNODB DEFAULT CHARSET=utf8mb4;
Create INDEX user_point_log_user_id_idx ON user_point_log(user_id);
<?php
/**
* CourseMediaDat Entity
* $Id: CourseMediaDat.inc,v 1.1 2020/1/17 14:38:28 Exp $
* @author lixq
* @package jp.compass.entity
* @access public
*/
class CourseMediaDat extends CompassDynamicData
{
var $course_id;
var $title;
var $tags;
var $front_image;
var $media;
var $teacher;
var $is_free;
var $price;
var $view_count;
var $delete_flg;
/**
* 构造实现。course_media_dat创建实例。
*
* @access public
* @param mixed course_media_dat
*/
function constructor($record)
{
parent::constructor($record);
$this->course_id = $record["course_id"];
$this->title = $record["title"];
$this->tags = $record["tags"];
$this->front_image = $record["front_image"];
$this->media = $record["media"];
$this->teacher = $record["teacher"];
$this->is_free = $record["is_free"];
$this->price = $record["price"];
$this->view_count = $record["view_count"];
$this->delete_flg = $record["delete_flg"];
}
/**
* 根据条件,获取数据列表。
* 条件与DBManager的doSelect相同。
* @access public
* @static
* @param array 检索条件
* @return array Entity的队列
*/
public static function getList($w_param = null, $orderkey = null, $direction = "ASC", $offset = null, $limit = null)
{
if ($w_param == null) {
$w_param = array();
$w_param["delete_flg"] = "false";
}
return CompassDBHandler::getList("CourseMediaDat", "course_media_dat", $w_param, $orderkey, $direction, $offset, $limit);
}
/**
* 根据条件,获取数据列表的件数。
* 条件与DBManager的doSelect相同。
* @access public
* @static
* @param array 检索条件
* @return array Entity的队列
*/
public static function getListCount($w_param = null)
{
if ($w_param == null) {
$w_param = array();
$w_param["delete_flg"] = "false";
}
$db = CompassDBManager::getInstance();
$result = $db->doSelect("course_media_dat", $w_param, null, null, null, null, "count(*) as count");
return $result[0]["count"];
}
/**
* 获得此类指定ID的实例。
*/
public static function getById($id)
{
// delete_flg
$param = array();
$param["delete_flg"] = false;
return CompassDBHandler::getById("CourseMediaDat", "course_media_dat", $id, $param);
}
// -- 这里开始Dynamic ---
/**
* 将此实例写入DB。
* DynamicData共用的保存方法。
* @access public
* @return int 写入实例的ID
*/
public function save()
{
$v_param = array();
ParamUtil::copyObj2Array($v_param, $this, "course_id");
ParamUtil::copyObj2Array($v_param, $this, "title");
ParamUtil::copyObj2Array($v_param, $this, "tags");
ParamUtil::copyObj2Array($v_param, $this, "front_image");
ParamUtil::copyObj2Array($v_param, $this, "media");
ParamUtil::copyObj2ArrayNullField($v_param, $this, "teacher");
ParamUtil::copyObj2Array($v_param, $this, "is_free");
ParamUtil::copyObj2Array($v_param, $this, "price");
ParamUtil::copyObj2Array($v_param, $this, "view_count");
ParamUtil::copyObj2Array($v_param, $this, "delete_flg");
// 保存
parent::_save("course_media_dat", $v_param);
}
}
\ No newline at end of file
<?php
/**
* CourseMst Entity
* $Id: CourseMst.inc,v 1.1 2020/1/17 14:38:28 Exp $
* @author lixq
* @package jp.compass.entity
* @access public
*/
class CourseMst extends CompassDynamicData
{
var $title;
var $front_image;
var $teacher_profile;
var $delete_flg;
/**
* 构造实现。course_mst创建实例。
*
* @access public
* @param mixed course_mst
*/
function constructor($record)
{
parent::constructor($record);
$this->title = $record["title"];
$this->front_image = $record["front_image"];
$this->teacher_profile = $record["teacher_profile"];
$this->delete_flg = $record["delete_flg"];
}
/**
* 根据条件,获取数据列表。
* 条件与DBManager的doSelect相同。
* @access public
* @static
* @param array 检索条件
* @return array Entity的队列
*/
public static function getList($w_param = null, $orderkey = null, $direction = "ASC", $offset = null, $limit = null)
{
if ($w_param == null) {
$w_param = array();
$w_param["delete_flg"] = "false";
}
return CompassDBHandler::getList("CourseMst", "course_mst", $w_param, $orderkey, $direction, $offset, $limit);
}
/**
* 根据条件,获取数据列表的件数。
* 条件与DBManager的doSelect相同。
* @access public
* @static
* @param array 检索条件
* @return array Entity的队列
*/
public static function getListCount($w_param = null)
{
if ($w_param == null) {
$w_param = array();
$w_param["delete_flg"] = "false";
}
$db = CompassDBManager::getInstance();
$result = $db->doSelect("course_mst", $w_param, null, null, null, null, "count(*) as count");
return $result[0]["count"];
}
/**
* 获得此类指定ID的实例。
*/
public static function getById($id)
{
// delete_flg
$param = array();
$param["delete_flg"] = false;
return CompassDBHandler::getById("CourseMst", "course_mst", $id, $param);
}
// -- 这里开始Dynamic ---
/**
* 将此实例写入DB。
* DynamicData共用的保存方法。
* @access public
* @return int 写入实例的ID
*/
public function save()
{
$v_param = array();
ParamUtil::copyObj2Array($v_param, $this, "title");
ParamUtil::copyObj2Array($v_param, $this, "front_image");
ParamUtil::copyObj2ArrayNullField($v_param, $this, "teacher_profile");
ParamUtil::copyObj2Array($v_param, $this, "delete_flg");
// 保存
parent::_save("course_mst", $v_param);
}
}
\ No newline at end of file
<?php
/**
* GovernmentQrDat Entity
* $Id: GovernmentQrDat.inc,v 1.1 2020/1/17 14:38:28 Exp $
* @author lixq
* @package jp.compass.entity
* @access public
*/
class GovernmentQrDat extends CompassDynamicData
{
var $government_id;
var $province;
var $city;
var $district;
var $max_count;
var $limit_date;
var $title;
var $delete_flg;
/**
* 构造实现。government_qr_dat创建实例。
*
* @access public
* @param mixed government_qr_dat
*/
function constructor($record)
{
parent::constructor($record);
$this->government_id = $record["government_id"];
$this->province = $record["province"];
$this->city = $record["city"];
$this->district = $record["district"];
$this->max_count = $record["max_count"];
$this->limit_date = $record["limit_date"];
$this->title = $record["title"];
$this->delete_flg = $record["delete_flg"];
}
/**
* 根据条件,获取数据列表。
* 条件与DBManager的doSelect相同。
* @access public
* @static
* @param array 检索条件
* @return array Entity的队列
*/
public static function getList($w_param = null, $orderkey = null, $direction = "ASC", $offset = null, $limit = null)
{
if ($w_param == null) {
$w_param = array();
$w_param["delete_flg"] = "false";
}
return CompassDBHandler::getList("GovernmentQrDat", "government_qr_dat", $w_param, $orderkey, $direction, $offset, $limit);
}
/**
* 根据条件,获取数据列表的件数。
* 条件与DBManager的doSelect相同。
* @access public
* @static
* @param array 检索条件
* @return array Entity的队列
*/
public static function getListCount($w_param = null)
{
if ($w_param == null) {
$w_param = array();
$w_param["delete_flg"] = "false";
}
$db = CompassDBManager::getInstance();
$result = $db->doSelect("government_qr_dat", $w_param, null, null, null, null, "count(*) as count");
return $result[0]["count"];
}
/**
* 获得此类指定ID的实例。
*/
public static function getById($id)
{
// delete_flg
$param = array();
$param["delete_flg"] = false;
return CompassDBHandler::getById("GovernmentQrDat", "government_qr_dat", $id, $param);
}
// -- 这里开始Dynamic ---
/**
* 将此实例写入DB。
* DynamicData共用的保存方法。
* @access public
* @return int 写入实例的ID
*/
public function save()
{
$v_param = array();
ParamUtil::copyObj2Array($v_param, $this, "government_id");
ParamUtil::copyObj2Array($v_param, $this, "province");
ParamUtil::copyObj2ArrayNullField($v_param, $this, "city");
ParamUtil::copyObj2ArrayNullField($v_param, $this, "district");
ParamUtil::copyObj2Array($v_param, $this, "max_count");
ParamUtil::copyObj2Array($v_param, $this, "limit_date");
ParamUtil::copyObj2Array($v_param, $this, "title");
ParamUtil::copyObj2Array($v_param, $this, "delete_flg");
// 保存
parent::_save("government_qr_dat", $v_param);
}
}
\ No newline at end of file
<?php
/**
* MediaTagDat Entity
* $Id: MediaTagDat.inc,v 1.1 2020/1/17 14:38:28 Exp $
* @author lixq
* @package jp.compass.entity
* @access public
*/
class MediaTagDat extends CompassDynamicData
{
var $tag;
var $delete_flg;
/**
* 构造实现。media_tag_dat创建实例。
*
* @access public
* @param mixed media_tag_dat
*/
function constructor($record)
{
parent::constructor($record);
$this->tag = $record["tag"];
$this->delete_flg = $record["delete_flg"];
}
/**
* 根据条件,获取数据列表。
* 条件与DBManager的doSelect相同。
* @access public
* @static
* @param array 检索条件
* @return array Entity的队列
*/
public static function getList($w_param = null, $orderkey = null, $direction = "ASC", $offset = null, $limit = null)
{
if ($w_param == null) {
$w_param = array();
$w_param["delete_flg"] = "false";
}
return CompassDBHandler::getList("MediaTagDat", "media_tag_dat", $w_param, $orderkey, $direction, $offset, $limit);
}
/**
* 根据条件,获取数据列表的件数。
* 条件与DBManager的doSelect相同。
* @access public
* @static
* @param array 检索条件
* @return array Entity的队列
*/
public static function getListCount($w_param = null)
{
if ($w_param == null) {
$w_param = array();
$w_param["delete_flg"] = "false";
}
$db = CompassDBManager::getInstance();
$result = $db->doSelect("media_tag_dat", $w_param, null, null, null, null, "count(*) as count");
return $result[0]["count"];
}
/**
* 获得此类指定ID的实例。
*/
public static function getById($id)
{
// delete_flg
$param = array();
$param["delete_flg"] = false;
return CompassDBHandler::getById("MediaTagDat", "media_tag_dat", $id, $param);
}
// -- 这里开始Dynamic ---
/**
* 将此实例写入DB。
* DynamicData共用的保存方法。
* @access public
* @return int 写入实例的ID
*/
public function save()
{
$v_param = array();
ParamUtil::copyObj2Array($v_param, $this, "tag");
ParamUtil::copyObj2Array($v_param, $this, "delete_flg");
// 保存
parent::_save("media_tag_dat", $v_param);
}
}
\ No newline at end of file
<?php
/**
* UserCertificateDat Entity
* $Id: UserCertificateDat.inc,v 1.1 2020/1/17 14:38:28 Exp $
* @author lixq
* @package jp.compass.entity
* @access public
*/
class UserCertificateDat extends CompassDynamicData
{
var $user_id;
var $certificate_id;
var $name;
var $mobile;
var $address;
var $status;
var $delete_flg;
/**
* 构造实现。user_certificate_dat创建实例。
*
* @access public
* @param mixed user_certificate_dat
*/
function constructor($record)
{
parent::constructor($record);
$this->user_id = $record["user_id"];
$this->certificate_id = $record["certificate_id"];
$this->name = $record["name"];
$this->mobile = $record["mobile"];
$this->address = $record["address"];
$this->status = $record["status"];
$this->delete_flg = $record["delete_flg"];
}
/**
* 根据条件,获取数据列表。
* 条件与DBManager的doSelect相同。
* @access public
* @static
* @param array 检索条件
* @return array Entity的队列
*/
public static function getList($w_param = null, $orderkey = null, $direction = "ASC", $offset = null, $limit = null)
{
if ($w_param == null) {
$w_param = array();
$w_param["delete_flg"] = "false";
}
return CompassDBHandler::getList("UserCertificateDat", "user_certificate_dat", $w_param, $orderkey, $direction, $offset, $limit);
}
/**
* 根据条件,获取数据列表的件数。
* 条件与DBManager的doSelect相同。
* @access public
* @static
* @param array 检索条件
* @return array Entity的队列
*/
public static function getListCount($w_param = null)
{
if ($w_param == null) {
$w_param = array();
$w_param["delete_flg"] = "false";
}
$db = CompassDBManager::getInstance();
$result = $db->doSelect("user_certificate_dat", $w_param, null, null, null, null, "count(*) as count");
return $result[0]["count"];
}
/**
* 获得此类指定ID的实例。
*/
public static function getById($id)
{
// delete_flg
$param = array();
$param["delete_flg"] = false;
return CompassDBHandler::getById("UserCertificateDat", "user_certificate_dat", $id, $param);
}
// -- 这里开始Dynamic ---
/**
* 将此实例写入DB。
* DynamicData共用的保存方法。
* @access public
* @return int 写入实例的ID
*/
public function save()
{
$v_param = array();
ParamUtil::copyObj2Array($v_param, $this, "user_id");
ParamUtil::copyObj2Array($v_param, $this, "certificate_id");
ParamUtil::copyObj2Array($v_param, $this, "name");
ParamUtil::copyObj2Array($v_param, $this, "mobile");
ParamUtil::copyObj2Array($v_param, $this, "address");
ParamUtil::copyObj2Array($v_param, $this, "status");
ParamUtil::copyObj2Array($v_param, $this, "delete_flg");
// 保存
parent::_save("user_certificate_dat", $v_param);
}
}
\ No newline at end of file
<?php
/**
* UserMediaDat Entity
* $Id: UserMediaDat.inc,v 1.1 2020/1/17 14:38:28 Exp $
* @author lixq
* @package jp.compass.entity
* @access public
*/
class UserMediaDat extends CompassDynamicData
{
var $user_id;
var $media_id;
var $is_free;
var $money;
var $order_no;
var $mchid_order_no;
var $status;
var $delete_flg;
/**
* 构造实现。user_media_dat创建实例。
*
* @access public
* @param mixed user_media_dat
*/
function constructor($record)
{
parent::constructor($record);
$this->user_id = $record["user_id"];
$this->media_id = $record["media_id"];
$this->is_free = $record["is_free"];
$this->money = $record["money"];
$this->order_no = $record["order_no"];
$this->mchid_order_no = $record["mchid_order_no"];
$this->status = $record["status"];
$this->delete_flg = $record["delete_flg"];
}
/**
* 根据条件,获取数据列表。
* 条件与DBManager的doSelect相同。
* @access public
* @static
* @param array 检索条件
* @return array Entity的队列
*/
public static function getList($w_param = null, $orderkey = null, $direction = "ASC", $offset = null, $limit = null)
{
if ($w_param == null) {
$w_param = array();
$w_param["delete_flg"] = "false";
}
return CompassDBHandler::getList("UserMediaDat", "user_media_dat", $w_param, $orderkey, $direction, $offset, $limit);
}
/**
* 根据条件,获取数据列表的件数。
* 条件与DBManager的doSelect相同。
* @access public
* @static
* @param array 检索条件
* @return array Entity的队列
*/
public static function getListCount($w_param = null)
{
if ($w_param == null) {
$w_param = array();
$w_param["delete_flg"] = "false";
}
$db = CompassDBManager::getInstance();
$result = $db->doSelect("user_media_dat", $w_param, null, null, null, null, "count(*) as count");
return $result[0]["count"];
}
/**
* 获得此类指定ID的实例。
*/
public static function getById($id)
{
// delete_flg
$param = array();
$param["delete_flg"] = false;
return CompassDBHandler::getById("UserMediaDat", "user_media_dat", $id, $param);
}
// -- 这里开始Dynamic ---
/**
* 将此实例写入DB。
* DynamicData共用的保存方法。
* @access public
* @return int 写入实例的ID
*/
public function save()
{
$v_param = array();
ParamUtil::copyObj2Array($v_param, $this, "user_id");
ParamUtil::copyObj2Array($v_param, $this, "media_id");
ParamUtil::copyObj2Array($v_param, $this, "is_free");
ParamUtil::copyObj2Array($v_param, $this, "money");
ParamUtil::copyObj2ArrayNullField($v_param, $this, "order_no");
ParamUtil::copyObj2ArrayNullField($v_param, $this, "mchid_order_no");
ParamUtil::copyObj2ArrayNullField($v_param, $this, "status");
ParamUtil::copyObj2Array($v_param, $this, "delete_flg");
// 保存
parent::_save("user_media_dat", $v_param);
}
}
\ No newline at end of file
<?php
/**
* 用户订单状态表
* $Id$
* @author zongbiao
* @package jp.fishow.entity.definition
*/
class OrderStatus
{
public $id;
public $name;
public $title;
function __construct($record) {
$this->id = $record["id"];
$this->name = $record["name"];
$this->title = $record["title"];
}
/**
* 返回示例的列表
* @return array ImageType一覧
*/
public static function getList() {
static $result;
if ((!is_array($result)) || (count($result) < 1)) {
$data = array();
$tmp = array("id"=>1, "name"=>"NEW", "title"=>"订单生成");
array_push($data, $tmp);
$tmp = array("id"=>2, "name"=>"SUCCESS", "title"=>"支付成功");
array_push($data, $tmp);
$tmp = array("id"=>3, "name"=>"CANCEL", "title"=>"取消支付");
array_push($data, $tmp);
$tmp = array("id"=>4, "name"=>"NG", "title"=>"其他错误");
array_push($data, $tmp);
$result = array();
foreach ($data as $row) {
$tmp2 = new OrderStatus($row);
array_push($result, $tmp2);
}
}
return $result;
}
/**
* 通过定义名称获取object
* @return OrderStatus 对应实例。没有的时候返回null。
*/
public static function getByName($name) {
$list = OrderStatus::getList();
foreach ($list as $tmp) {
if ($tmp->name == $name) {
return $tmp;
}
}
return null;
}
/**
* 通过定义名称获取title
*/
public static function getTitleByName($name) {
$list = OrderStatus::getList();
foreach ($list as $tmp) {
if ($tmp->name == $name) {
return $tmp->title;
}
}
return null;
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment