dever 7 years ago
parent
commit
f213fb4d0a

+ 16 - 0
component/config/component/applet.php

@@ -224,5 +224,21 @@ $config['applet_revert'] = array
 	),
 );
 
+$config['applet_unaudit'] = array
+(
+	'name' => '小程序审核撤回',
+	'method' => 'get',
+	'json' => false,
+	'url' => 'https://api.weixin.qq.com/wxa/undocodeaudit?',
+	'param' => array
+	(
+		'access_token' => 'oauth',
+	),
+	'response' => array
+	(
+		'errmsg' => 'errmsg',
+	),
+);
+
 
 return $config;

+ 156 - 0
component/database/unaudit.php

@@ -0,0 +1,156 @@
+<?php
+/**
+ * tester
+ */
+
+$status = array
+(
+	1 => '撤回中',
+	2 => '撤回成功',
+	3 => '撤回失败',
+);
+
+$user = function()
+{
+	$array = array();
+	$info = Dever::load('component/user-state');
+	if($info)
+	{
+		$array += $info;
+	}
+	return $array;
+};
+
+$template = function()
+{
+	$array = array();
+	$info = Dever::load('component/template-state');
+	if($info)
+	{
+		$array += $info;
+	}
+	return $array;
+};
+
+$version = function()
+{
+	$array = array();
+	$info = Dever::load('component/version-state');
+	if($info)
+	{
+		$array += $info;
+	}
+	return $array;
+};
+
+
+return array
+(
+	# 表名
+	'name' => 'unaudit',
+	# 显示给用户看的名称
+	'lang' => '审核撤回历史',
+	'order' => 1,
+	# 数据结构
+	'struct' => array
+	(
+		'id' 		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> 'ID',
+			'default' 	=> '',
+			'desc' 		=> '',
+			'match' 	=> 'is_numeric',
+			'search'	=> 'order',
+			//'list'		=> true,
+		),
+
+		'project_id'		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> '项目',
+			'default' 	=> '',
+			'desc' 		=> '请输入项目',
+			'match' 	=> 'is_numeric',
+		),
+
+		'version_id'		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> '版本',
+			'default' 	=> '',
+			'desc' 		=> '版本',
+			'match' 	=> 'is_numeric',
+			//'search'	=> 'order,fulltext',
+			'update'	=> 'checkbox',
+			'option'	=> $version,
+			'list'		=> true,
+		),
+
+		'user_id'		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> '用户',
+			'default' 	=> '',
+			'desc' 		=> '用户',
+			'match' 	=> 'is_numeric',
+			//'search'	=> 'order,fulltext',
+			'update'	=> 'select',
+			'option'	=> $user,
+			'list'		=> true,
+		),
+
+		'result'		=> array
+		(
+			'type' 		=> 'text-255',
+			'name' 		=> '微信返回信息',
+			'default' 	=> '',
+			'desc' 		=> '微信返回信息',
+			'match' 	=> 'option',
+			'update'	=> 'textarea',
+			'list'		=> true,
+			'modal'		=> '查看详情',
+		),
+
+		'status'		=> array
+		(
+			'type' 		=> 'tinyint-1',
+			'name' 		=> '撤回状态',
+			'default' 	=> '1',
+			'desc' 		=> '撤回状态',
+			'match' 	=> 'is_numeric',
+			'update'	=> 'select',
+			'option'	=> $status,
+			'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,
+			//'list'		=> 'date("Y-m-d H:i:s", {cdate})',
+		),
+	),
+
+	'top' => Dever::config('base', 'component')->top,
+
+	'manage' => array
+	(
+		'edit' => false,
+		'delete' => false,
+		'insert' => false,
+	),
+);

+ 4 - 2
component/database/version.php

@@ -54,7 +54,7 @@ return array
 			'desc' 		=> '',
 			'match' 	=> 'is_numeric',
 			'search'	=> 'order',
-			'list'		=> true,
+			//'list'		=> true,
 		),
 
 		'project_id'		=> array
@@ -110,7 +110,7 @@ return array
 			'desc' 		=> '版本描述',
 			'match' 	=> 'option',
 			'update'	=> 'textarea',
-			'list'		=> true,
+			//'list'		=> true,
 		),
 		
 		'state'		=> array
@@ -154,6 +154,8 @@ return array
 
 			'oper' => array('提审', '"component/auditing.submit?id={id}"'),
 
+			'oper3' => array('撤回', '"component/unaudit.submit?id={id}"'),
+
 			'oper1' => array('发布', '"component/publish.submit?id={id}"'),
 
 			'oper2' => array('回退', '"component/revert.submit?id={id}"'),

+ 38 - 0
component/src/Unaudit.php

@@ -0,0 +1,38 @@
+<?php
+/*
+|--------------------------------------------------------------------------
+| tester 体验者设置
+|--------------------------------------------------------------------------
+*/
+namespace Component\Src;
+
+use Dever;
+use Main\Lib\Wechat;
+
+class Unaudit extends Core
+{
+	public $table = 'unaudit';
+
+	public function submit()
+	{
+		$id = Dever::input('id');
+		$info = Dever::db('component/version')->one($id);
+		$user = explode(',', $info['user']);
+		foreach ($user as $k => $v) {
+			$param = array();
+			$param['user_id'] = $v;
+			$param['project_id'] = $info['project_id'];
+			$param['version_id'] = $info['id'];
+			$id = Dever::upinto('component/unaudit', array('option_user_id' => $v, 'option_project_id' => $param['project_id'], 'option_version_id' => $param['version_id']), $param);
+			$this->set($v, $id);
+		}
+		Dever::alert('提交成功,请到审核撤回历史中查看撤回状态');
+		return;
+	}
+
+	public function handle($oauth, $info, $delete, $user, $wechat)
+	{
+		$oauth['method'] = 'applet_unaudit';
+		return $oauth;
+	}
+}