rabin 6 年之前
父节点
当前提交
8a4e1823a0

+ 145 - 0
journal/database/active.php

@@ -0,0 +1,145 @@
+<?php
+
+return array
+(
+    # 表名
+    'name' => 'active',
+    # 显示给用户看的名称
+    'lang' => '活动设置',
+    'menu' => false,
+    'end' => array
+    (
+        //'update' => 'service/lib/manage.feedback',
+        //'insert' => 'service/lib/manage.feedback',
+    ),
+    # 数据结构
+    'struct' => array
+    (
+    
+        'id'        => array
+        (
+            'type'      => 'int-11',
+            'name'      => 'ID',
+            'default'   => '',
+            'desc'      => '',
+            'match'     => 'is_numeric',
+            'search'    => 'order',
+            'update'    => 'hidden',
+            'value'     => Dever::input('where_id')
+            //'list'        => true,
+        ),
+
+        'info_id'      => array
+        (
+            'type'      => 'int-11',
+            'name'      => '小刊',
+            'default'   => '',
+            'desc'      => '小刊',
+            'match'     => 'is_numeric',
+            'update'    => 'hidden',
+            'value'     => Dever::input('search_option_info_id')
+        ),
+
+        'name'      => array
+        (
+            'type'      => 'varchar-80',
+            'name'      => '活动标题',
+            'default'   => '',
+            'desc'      => '活动标题',
+            'match'     => 'is_string',
+            'update'    => 'text',
+            'search'    => 'fulltext',
+            'list'      => true,
+        ),
+
+        'desc'      => array
+        (
+            'type'      => 'varchar-800',
+            'name'      => '活动描述',
+            'default'   => '',
+            'desc'      => '活动描述',
+            'match'     => 'option',
+            'update'  => 'textarea',
+            //'search'  => 'fulltext',
+            //'list'        => true,
+        ),
+
+        'invite_num'     => array
+        (
+            'type'      => 'int-11',
+            'name'      => '邀请多少个好友开启免费阅读',
+            'default'   => '10',
+            'desc'      => '邀请多少个好友开启免费阅读',
+            'match'     => 'is_numeric',
+            'update'    => 'text',
+        ),
+
+        'invite_score'     => array
+        (
+            'type'      => 'int-11',
+            'name'      => '每邀请一个好友获得积分',
+            'default'   => '2',
+            'desc'      => '每邀请一个好友获得积分',
+            'match'     => 'is_numeric',
+            'update'    => 'text',
+        ),
+
+        'invite_title'     => array
+        (
+            'type'      => 'varchar-80',
+            'name'      => '邀请好友标题',
+            'default'   => '',
+            'desc'      => '邀请好友标题',
+            'match'     => 'is_string',
+            'update'    => 'text',
+        ),
+
+        'invite_desc'      => array
+        (
+            'type'      => 'varchar-800',
+            'name'      => '邀请好友标题介绍',
+            'default'   => '',
+            'desc'      => '邀请好友标题介绍',
+            'match'     => 'is_string',
+            'update'    => 'textarea',
+        ),
+
+        'content'       => array
+        (
+            'type'      => 'text-255',
+            'name'      => '活动规则说明',
+            'default'   => '',
+            'desc'      => '活动规则说明',
+            'match'     => 'is_string',
+            'update'    => 'editor',
+            'key'       => 1,
+        ),
+        
+
+        'state'     => array
+        (
+            'type'      => 'tinyint-1',
+            'name'      => '状态',
+            'default'   => '1',
+            'desc'      => '请选择状态',
+            'match'     => 'is_numeric',
+        ),
+        
+        'cdate'     => array
+        (
+            'type'      => 'int-11',
+            'name'      => '创建时间',
+            'match'     => array('is_numeric', time()),
+            'desc'      => '',
+            # 只有insert时才生效
+            'insert'    => true,
+            'search'    => 'date',
+            //'list'      => 'date("Y-m-d H:i:s", {cdate})',
+        ),
+    ),
+
+    'manage' => array
+    (
+
+    ),
+);

+ 110 - 0
journal/database/buy.php

@@ -0,0 +1,110 @@
+<?php
+
+return array
+(
+    # 表名
+    'name' => 'buy',
+    # 显示给用户看的名称
+    'lang' => '购买设置',
+    'menu' => false,
+    'end' => array
+    (
+        //'update' => 'service/lib/manage.feedback',
+        //'insert' => 'service/lib/manage.feedback',
+    ),
+    # 数据结构
+    'struct' => array
+    (
+    
+        'id'        => array
+        (
+            'type'      => 'int-11',
+            'name'      => 'ID',
+            'default'   => '',
+            'desc'      => '',
+            'match'     => 'is_numeric',
+            'search'    => 'order',
+            'update'    => 'hidden',
+            'value'     => Dever::input('where_id')
+            //'list'        => true,
+        ),
+
+        'info_id'      => array
+        (
+            'type'      => 'int-11',
+            'name'      => '小刊',
+            'default'   => '',
+            'desc'      => '小刊',
+            'match'     => 'is_numeric',
+            'update'    => 'hidden',
+            'value'     => Dever::input('search_option_info_id')
+        ),
+
+        'buy_score'     => array
+        (
+            'type'      => 'int-11',
+            'name'      => '每购买一本刊获得多少积分',
+            'default'   => '20',
+            'desc'      => '每购买一本刊获得多少积分',
+            'match'     => 'is_numeric',
+            'update'    => 'text',
+        ),
+
+        'buy_title'     => array
+        (
+            'type'      => 'varchar-80',
+            'name'      => '购买小刊标题',
+            'default'   => '',
+            'desc'      => '购买小刊标题',
+            'match'     => 'is_string',
+            'update'    => 'text',
+        ),
+
+        'buy_desc'      => array
+        (
+            'type'      => 'varchar-800',
+            'name'      => '购买小刊介绍',
+            'default'   => '',
+            'desc'      => '购买小刊介绍',
+            'match'     => 'is_string',
+            'update'    => 'textarea',
+        ),
+
+        'buy_content'       => array
+        (
+            'type'      => 'text-255',
+            'name'      => '购买说明',
+            'default'   => '',
+            'desc'      => '请输入内容',
+            'match'     => 'is_string',
+            'update'    => 'editor',
+            'key'       => 1,
+        ),
+        
+        'state'     => array
+        (
+            'type'      => 'tinyint-1',
+            'name'      => '状态',
+            'default'   => '1',
+            'desc'      => '请选择状态',
+            'match'     => 'is_numeric',
+        ),
+        
+        'cdate'     => array
+        (
+            'type'      => 'int-11',
+            'name'      => '创建时间',
+            'match'     => array('is_numeric', time()),
+            'desc'      => '',
+            # 只有insert时才生效
+            'insert'    => true,
+            'search'    => 'date',
+            //'list'      => 'date("Y-m-d H:i:s", {cdate})',
+        ),
+    ),
+
+    'manage' => array
+    (
+
+    ),
+);

+ 188 - 0
journal/database/buy_num.php

@@ -0,0 +1,188 @@
+<?php
+
+# 定义几个常用的选项
+$status = array
+(
+    1 => '在线',
+    2 => '下线',
+);
+
+$type = array
+(
+    1 => '购买',
+    2 => '兑换',
+);
+
+return array
+(
+    # 表名
+    'name' => 'buy_num',
+    # 显示给用户看的名称
+    'lang' => '购买本数设置',
+    'order' => 100,
+    'menu' => false,
+    'end' => array
+    (
+        //'update' => 'code/lib/manage.create',
+        //'insert' => 'code/lib/manage.create',
+    ),
+    # 数据结构
+    'struct' => array
+    (
+    
+        'id'        => array
+        (
+            'type'      => 'int-11',
+            'name'      => 'ID',
+            'default'   => '',
+            'desc'      => '',
+            'match'     => 'is_numeric',
+            'search'    => 'order',
+            //'list'        => true,
+        ),
+
+        'info_id'        => array
+        (
+            'type'      => 'int-11',
+            'name'      => '小刊',
+            'default'   => '',
+            'desc'      => '小刊',
+            'match'     => 'is_numeric',
+            'update'    => 'hidden',
+            'value'     => Dever::input('search_option_info_id')
+        ),
+
+        'name'      => array
+        (
+            'type'      => 'varchar-80',
+            'name'      => '购买名称-一般为“购买n本”,如购买1本',
+            'default'   => '',
+            'desc'      => '购买名称',
+            'match'     => 'is_string',
+            'update'    => 'text',
+            'search'    => 'fulltext',
+            'list'      => true,
+        ),
+
+        'price'     => array
+        (
+            'type'      => 'varchar-50',
+            'name'      => '购买时的标价',
+            'default'   => '',
+            'desc'      => '购买时的标价',
+            'match'     => 'is_string',
+            'update'    => 'text',
+        ),
+
+        'type'      => array
+        (
+            'type'      => 'varchar-150',
+            'name'      => '获取方式',
+            'default'   => '1',
+            'desc'      => '获取方式',
+            'match'     => 'is_numeric',
+            'option'    => $type,
+            'search'    => 'select',
+            'update'    => 'checkbox',
+            'list'      => true,
+            'control'   => 'type',
+        ),
+
+        'cash'      => array
+        (
+            'type'      => 'varchar-50',
+            'name'      => '支付价格-实际支付价格,单位元,直接填写数字即可',
+            'default'   => '',
+            'desc'      => '支付价格',
+            'match'     => 'is_string',
+            'update'    => 'text',
+            'show'      => 'type=1',
+        ),
+
+        'code'      => array
+        (
+            'type'      => 'varchar-50',
+            'name'      => '兑换码数量-直接填写数字即可,系统将自动生成对应数量的兑换码',
+            'default'   => '',
+            'desc'      => '兑换码数量',
+            'match'     => 'is_string',
+            'update'    => 'text',
+            'show'      => 'type=2',
+        ),
+
+        'reorder'       => array
+        (
+            'type'      => 'int-11',
+            'name'      => '排序(数值越大越靠前)',
+            'default'   => '1',
+            'desc'      => '请输入排序',
+            'match'     => 'option',
+            'update'    => 'text',
+            'search'    => 'order',
+            'list_name' => '排序',
+            'list'      => true,
+            'order'     => 'desc',
+            'edit'      => true,
+        ),
+
+        'state'     => array
+        (
+            'type'      => 'tinyint-1',
+            'name'      => '状态',
+            'default'   => '1',
+            'desc'      => '请选择状态',
+            'match'     => 'is_numeric',
+        ),
+        
+        'cdate'     => array
+        (
+            'type'      => 'int-11',
+            'name'      => '添加时间',
+            'match'     => array('is_numeric', time()),
+            'desc'      => '',
+            # 只有insert时才生效
+            'insert'    => true,
+            'search'    => 'date',
+            'list'      => 'date("Y-m-d H:i:s", {cdate})',
+        ),
+    ),
+
+    'manage' => array
+    (
+        'list_button' => array
+        (
+            'list' => array('兑换码列表', '"code&project=journal&search_option_product_id={info_id}&search_option_product_price_id={id}&oper_parent=buy_num&oper_project=journal"'),
+        ),
+    ),
+
+
+    'request' => array
+    (
+        'getAll' => array
+        (
+            # 匹配的正则或函数 选填项
+            'option' => array
+            (
+                'info_id' => 'yes',
+                'state' => 1,
+            ),
+            'type' => 'all',
+            'order' => array('reorder' => 'desc', 'cdate' => 'desc'),
+            'col' => '*',
+        ),
+
+        # 最低价格的
+        'getDataByMin' => array
+        (
+            # 匹配的正则或函数 选填项
+            'option' => array
+            (
+                'info_id' => 'yes',
+                'state' => 1,
+            ),
+            'type' => 'one',
+            'order' => array('cash' => 'asc','reorder' => 'desc', 'cdate' => 'desc'),
+            'col' => '*',
+        ),
+    ),
+);

+ 3 - 3
journal/database/code.php

@@ -15,7 +15,7 @@ $product = function()
 
 $product_price = function()
 {
-	return Dever::db('journal/info_price')->state();
+	return Dever::db('journal/buy')->state();
 };
 
 return array
@@ -61,9 +61,9 @@ return array
 			'desc' 		=> '小刊价格',
 			'match' 	=> 'is_numeric',
 			//'update'	=> 'select',
-			//'option'	=> $product_price,
+			'option'	=> $product_price,
 			'search'	=> 'select',
-			//'list'		=> true,
+			'list'		=> true,
 		),
 
 		'code'		=> array

+ 80 - 0
journal/database/content.php

@@ -0,0 +1,80 @@
+<?php
+
+return array
+(
+    # 表名
+    'name' => 'content',
+    # 显示给用户看的名称
+    'lang' => '内页管理',
+    'menu' => false,
+    'end' => array
+    (
+        //'update' => 'service/lib/manage.feedback',
+        //'insert' => 'service/lib/manage.feedback',
+    ),
+    # 数据结构
+    'struct' => array
+    (
+    
+        'id'        => array
+        (
+            'type'      => 'int-11',
+            'name'      => 'ID',
+            'default'   => '',
+            'desc'      => '',
+            'match'     => 'is_numeric',
+            'search'    => 'order',
+            'update'    => 'hidden',
+            'value'     => Dever::input('where_id')
+            //'list'        => true,
+        ),
+
+        'info_id'      => array
+        (
+            'type'      => 'int-11',
+            'name'      => '小刊',
+            'default'   => '',
+            'desc'      => '小刊',
+            'match'     => 'is_numeric',
+            'update'    => 'hidden',
+            'value'     => Dever::input('search_option_info_id')
+        ),
+
+        'name'     => array
+        (
+            'type'      => 'varchar-80',
+            'name'      => '内页标题',
+            'default'   => '',
+            'desc'      => '内页标题',
+            'match'     => 'is_string',
+            'update'    => 'text',
+            'list'      => true,
+        ),
+        
+        'state'     => array
+        (
+            'type'      => 'tinyint-1',
+            'name'      => '状态',
+            'default'   => '1',
+            'desc'      => '请选择状态',
+            'match'     => 'is_numeric',
+        ),
+        
+        'cdate'     => array
+        (
+            'type'      => 'int-11',
+            'name'      => '创建时间',
+            'match'     => array('is_numeric', time()),
+            'desc'      => '',
+            # 只有insert时才生效
+            'insert'    => true,
+            'search'    => 'date',
+            //'list'      => 'date("Y-m-d H:i:s", {cdate})',
+        ),
+    ),
+
+    'manage' => array
+    (
+
+    ),
+);

+ 28 - 4
journal/database/info.php

@@ -41,6 +41,13 @@ return array
 			'desc' 		=> '',
 			'match' 	=> 'is_numeric',
 		),
+
+		'hr1'		=> array
+		(
+			'name' 		=> '基本设置',
+			'class'		=> '',//本项必须填写
+			'attr'		=> '',
+		),
 		
 		'name'		=> array
 		(
@@ -50,6 +57,7 @@ return array
 			'desc' 		=> '标题',
 			'match' 	=> 'is_string',
 			'update'	=> 'text',
+			'search'	=> 'fulltext',
 			'list'		=> true,
 		),
 
@@ -88,6 +96,18 @@ return array
 			'place'		=> '150',
 		),
 
+		'pic_view_bg'		=> array
+		(
+			'type' 		=> 'text-255',
+			'name' 		=> '全屏背景图-进入小刊阅读页之前的全屏背景图,可以多张切换,尽量保持在5张之内',
+			'default' 	=> '',
+			'desc' 		=> '全屏背景图',
+			'match' 	=> 'option',
+			'update'	=> 'images',
+			'key' 		=> '1',
+			'place'		=> '150',
+		),
+
 		'num_add_ding'		=> array
 		(
 			'type' 		=> 'int-11',
@@ -165,7 +185,7 @@ return array
 		'audit'		=> array
 		(
 			'type' 		=> 'int-11',
-			'name' 		=> '审核状态',
+			'name' 		=> '上线状态',
 			'default' 	=> '1',
 			'desc' 		=> '审核',
 			'match' 	=> 'is_numeric',
@@ -242,13 +262,17 @@ return array
 	'manage' => array
 	(
 		//'insert' => false,
+		'delete' => false,
 		# 列表
-		/*
 		'list_button' => array
 		(
-			'list' => array('评论列表', '"comment&search_option_data_id={id}&oper_parent=article"'),
+			'list' => array('内页管理', '"content&search_option_info_id={id}&oper_parent=info"' , '{audit} == 1'),
+			'br' => array('<br />'),
+			'add' => array('购买设置', '"buy&project=journal&search_option_info_id={id}&oper_parent=info&oper_project=journal&oper_save_jump=info&where_id={id}"', '{audit} == 1'),
+			'add1' => array('活动设置', '"active&project=journal&search_option_info_id={id}&oper_parent=info&oper_project=journal&oper_save_jump=info&where_id={id}"', '{audit} == 1'),
+			'br1' => array('<br />'),
+			'list1' => array('购买本数管理', '"buy_num&search_option_info_id={id}&oper_parent=info"' , '{audit} == 1'),
 		),
-		*/
 	),
 
 	# request 请求接口定义

+ 309 - 0
journal/database/order.php

@@ -0,0 +1,309 @@
+<?php
+
+$type = array
+(
+    1 => '购买',
+    2 => '兑换',
+);
+
+$status = array
+(
+    1 => '待支付',
+    2 => '已支付',
+    3 => '支付失败',
+    //4 => '申请退款',
+    5 => '已退款',
+);
+
+$product = function()
+{
+    return Dever::db('journal/info')->state();
+};
+
+return array
+(
+    # 表名
+    'name' => 'order',
+    # 显示给用户看的名称
+    'lang' => '订单管理',
+    'order' => 100,
+
+    'end' => array
+    (
+        //'update' => 'journal/lib/manage.order',
+    ),
+
+    # 数据结构
+    'struct' => array
+    (
+    
+        'id'        => array
+        (
+            'type'      => 'int-11',
+            'name'      => 'ID',
+            'default'   => '',
+            'desc'      => '',
+            'match'     => 'is_numeric',
+            'search'    => 'order',
+            'list'      => true,
+        ),
+
+        'order_id'      => array
+        (
+            'type'      => 'varchar-100',
+            'name'      => '订单id',
+            'default'   => '',
+            'desc'      => '付款订单id',
+            'match'     => 'is_string',
+            'update'    => 'text',
+            'search'    => 'fulltext',
+            //'list'        => true,
+            //'list'        => '"{order_id}" ? "{order_id}" : "{code}"',
+        ), 
+
+        'name'      => array
+        (
+            'type'      => 'varchar-80',
+            'name'      => '订单名称',
+            'default'   => '',
+            'desc'      => '订单名称',
+            'match'     => 'is_string',
+            'update'    => 'text',
+            'search'    => 'fulltext',
+            'list_name' => '订单信息',
+            //'list'      => 'Dever::load("journal/lib/manage.showOrderUser", "{id}")',
+        ),
+
+        'uid'       => array
+        (
+            'type'      => 'int-11',
+            'name'      => '用户id',
+            'default'   => '',
+            'desc'      => '用户id',
+            'match'     => 'is_numeric',
+            'update'    => 'text',
+        ),
+
+        'product_id'        => array
+        (
+            'type'      => 'int-11',
+            'name'      => '小刊',
+            'default'   => '',
+            'desc'      => '小刊',
+            'match'     => 'is_numeric',
+            'update'    => 'select',
+            'option'    => $product,
+            'search'    => 'select',
+            //'list'        => true,
+        ),
+
+        'type'      => array
+        (
+            'type'      => 'int-11',
+            'name'      => '支付方式',
+            'default'   => '1',
+            'desc'      => '支付方式',
+            'match'     => 'is_numeric',
+            'option'    => $type,
+            'search'    => 'select',
+            'update'    => 'radio',
+            //'list'        => true,
+            'control'   => 'type',
+        ),
+
+        'notice'        => array
+        (
+            'type'      => 'int-11',
+            'name'      => '模板消息提醒次数',
+            'default'   => '0',
+            'desc'      => '模板消息提醒次数',
+            'match'     => 'is_numeric',
+        ),
+
+        'cash'      => array
+        (
+            'type'      => 'varchar-50',
+            'name'      => '支付金额',
+            'default'   => '',
+            'desc'      => '支付金额',
+            'match'     => 'option',
+            'update'    => 'text',
+            //'list'        => true,
+            'show'      => 'type=1',
+        ),
+
+        'code'      => array
+        (
+            'type'      => 'varchar-50',
+            'name'      => '使用的兑换码',
+            'default'   => '',
+            'desc'      => '使用的兑换码',
+            'match'     => 'option',
+            'update'    => 'text',
+            //'list'        => true,
+            'show'      => 'type=2',
+        ),
+
+        'status'        => array
+        (
+            'type'      => 'tinyint-1',
+            'name'      => '订单状态',
+            'default'   => '1',
+            'desc'      => '请选择订单状态',
+            'match'     => 'is_numeric',
+            'option'    => $status,
+            'search'    => 'select',
+            'update'    => 'radio',
+            //'list'      => 'Dever::load("service/lib/manage.showOrderStatus", "{id}")',
+            'control'   => 'status',
+        ),
+
+        'tk_time'       => array
+        (
+            'type'      => 'int-11',
+            'name'      => '退款时间',
+            'default'   => '',
+            'desc'      => '退款时间',
+            'match'     => 'option',
+            //'list'        => true,
+            'show'      => 'status=5',
+        ),
+
+        'tk_admin'      => array
+        (
+            'type'      => 'int-11',
+            'name'      => '退款审核人',
+            'default'   => '1',
+            'desc'      => '退款审核人',
+            'match'     => 'option',
+            //'list'        => true,
+            'show'      => 'status=5',
+        ),
+
+        'tk_desc'       => array
+        (
+            'type'      => 'varchar-300',
+            'name'      => '退款备注',
+            'default'   => '',
+            'desc'      => '退款备注',
+            'match'     => 'option',
+            'update'    => 'textarea',
+            //'show'        => 'status=5',
+        ),
+
+        'state'     => array
+        (
+            'type'      => 'tinyint-1',
+            'name'      => '状态',
+            'default'   => '1',
+            'desc'      => '请选择状态',
+            'match'     => 'is_numeric',
+        ),
+        
+        'cdate'     => array
+        (
+            'type'      => 'int-11',
+            'name'      => '下单时间',
+            'match'     => array('is_numeric', time()),
+            'desc'      => '',
+            # 只有insert时才生效
+            'insert'    => true,
+            'search'    => 'date',
+            'list'        => 'date("Y-m-d H:i:s", {cdate})',
+            //'list'      => 'Dever::load("service/lib/manage.showOrderTime", "{id}")',
+        ),
+
+        'info'      => array
+        (
+            'type'      => 'varchar-300',
+            'name'      => '备注',
+            'default'   => '',
+            'desc'      => '备注',
+            'match'     => 'option',
+            'update'    => 'textarea',
+            //'show'        => 'status=5'
+            'list'      => '"{info}" ? "{info}" : "双击添加备注"',
+            'edit'      => true,
+        ),
+
+        'mobile'        => array
+        (
+            'type'      => 'varchar-300',
+            'name'      => '手机号',
+            'default'   => '',
+            'desc'      => '手机号',
+            'match'     => 'option',
+            //'show'        => 'status=5'
+            'search'    => array
+            (
+                'api' => 'passport/user-all',//接口地址,最好是获取多条数据的地址
+                'col' => 'mobile',//要查询的字段
+                'result' => 'id',//返回的字段
+                'search' => 'uid',//本表的字段,默认为当前的字段
+            ),
+        ),
+    ),
+
+    'manage' => array
+    (
+        //'delete' => false,
+        //'edit' => false,
+        //'insert' => false,
+
+        'button' => array
+        (
+            '导出订单' => array('location', 'service/lib/manage.out'),
+        ),
+
+        'list_button' => array(
+            'edit' => array('退款', 'tk_time,tk_desc,tk_admin', '{status} > 1'),
+            'delete' => array('删除', '', '{status} == 1'),
+        ),
+    ),
+
+    'request' => array
+    (
+        'getAll' => array
+        (
+            # 匹配的正则或函数 选填项
+            'option' => array
+            (
+                'status' => array('1', '!='),
+                'uid' => 'yes',
+                'state' => 1,
+            ),
+            'type' => 'all',
+            'order' => array('cdate' => 'desc'),
+            'page' => array(10, 'list'),
+            'col' => '*',
+        ),
+
+        'getYes' => array
+        (
+            # 匹配的正则或函数 选填项
+            'option' => array
+            (
+                'product_id' => 'yes',
+                'state' => 1,
+            ),
+            'type' => 'all',
+            'order' => array('cdate' => 'desc'),
+            'col' => '*',
+        ),
+
+        # 获取提交订单超过12个小时
+        'getDataByTime' => array
+        (
+            # 匹配的正则或函数 选填项
+            'option' => array
+            (
+                'cdate' => array('yes', '>='),
+                'notice' => 'yes',
+                'state' => 1,
+            ),
+            'type' => 'all',
+            'order' => array('cdate' => 'desc'),
+            'col' => '*',
+        ),
+    ),
+);

+ 3 - 3
journal/lib/Manage.php

@@ -37,12 +37,12 @@ class Manage
 		$code = Dever::param('code', $data);
 		$type = Dever::param('type', $data);
 		$product_id = Dever::param('product_id', $data);
-		$product_id = $id;
+		//$product_id = $id;
 		if (!in_array(2, $type)) {
 			return;
 		}
 
-		$total = Dever::db('code/info')->total(array('product_id' => $product_id,'product_price_id' => $id, 'type' => 1));
+		$total = Dever::db('journal/code')->total(array('product_id' => $product_id,'product_price_id' => $id, 'type' => 1));
 		if ($code > 0 && $code > $total) {
 			$num = $code - $total;
 
@@ -58,7 +58,7 @@ class Manage
 		$data['product_id'] = $product_id;
 		$data['product_price_id'] = $id;
 		$data['code'] = $code;
-		$total = Dever::db('code/info')->total($data);
+		$total = Dever::db('journal/code')->total($data);
 		if ($total > 0) {
 			return $this->createCode($product_id, $id);
 		}