dever 7 år sedan
förälder
incheckning
bb4944014f

+ 14 - 1
component/database/auditing.php

@@ -85,7 +85,19 @@ return array
 			//'search'	=> 'order,fulltext',
 			'update'	=> 'checkbox',
 			'option'	=> $version,
-			'list'		=> true,
+			//'list'		=> true,
+		),
+
+		'name'		=> array
+		(
+			'type' 		=> 'varchar-60',
+			'name' 		=> '版本号',
+			'default' 	=> '',
+			'desc' 		=> '版本号',
+			'match' 	=> 'is_string',
+			'update'	=> 'text',
+			'search'	=> 'fulltext',
+			'list'		=> '"{name}" ? "{name}" : Dever::load("component/version-one#name", {version_id})',
 		),
 
 		'user_id'		=> array
@@ -165,6 +177,7 @@ return array
 			'match' 	=> array('is_numeric', time()),
 			'desc' 		=> '',
 			'default' 	=> '',
+			'order'		=> 'desc',
 			'list'		=> 'date("Y-m-d H:i:s", {mdate})',
 		),
 		

+ 1 - 1
component/database/page.php

@@ -66,7 +66,7 @@ return array
 			'update'	=> 'select',
 			'search'	=> 'select',
 			'option'	=> $template,
-			'list'		=> true,
+			//'list'		=> true,
 		),
 
 		'pagepath'		=> array

+ 13 - 1
component/database/publish.php

@@ -84,7 +84,19 @@ return array
 			//'search'	=> 'order,fulltext',
 			'update'	=> 'checkbox',
 			'option'	=> $version,
-			'list'		=> true,
+			//'list'		=> true,
+		),
+
+		'name'		=> array
+		(
+			'type' 		=> 'varchar-60',
+			'name' 		=> '版本号',
+			'default' 	=> '',
+			'desc' 		=> '版本号',
+			'match' 	=> 'is_string',
+			'update'	=> 'text',
+			'search'	=> 'fulltext',
+			'list'		=> '"{name}" ? "{name}" : Dever::load("component/version-one#name", {version_id})',
 		),
 
 		'user_id'		=> array

+ 13 - 1
component/database/revert.php

@@ -84,7 +84,19 @@ return array
 			//'search'	=> 'order,fulltext',
 			'update'	=> 'checkbox',
 			'option'	=> $version,
-			'list'		=> true,
+			//'list'		=> true,
+		),
+
+		'name'		=> array
+		(
+			'type' 		=> 'varchar-60',
+			'name' 		=> '版本号',
+			'default' 	=> '',
+			'desc' 		=> '版本号',
+			'match' 	=> 'is_string',
+			'update'	=> 'text',
+			'search'	=> 'fulltext',
+			'list'		=> '"{name}" ? "{name}" : Dever::load("component/version-one#name", {version_id})',
 		),
 
 		'user_id'		=> array

+ 13 - 1
component/database/unaudit.php

@@ -84,7 +84,19 @@ return array
 			//'search'	=> 'order,fulltext',
 			'update'	=> 'checkbox',
 			'option'	=> $version,
-			'list'		=> true,
+			//'list'		=> true,
+		),
+
+		'name'		=> array
+		(
+			'type' 		=> 'varchar-60',
+			'name' 		=> '版本号',
+			'default' 	=> '',
+			'desc' 		=> '版本号',
+			'match' 	=> 'is_string',
+			'update'	=> 'text',
+			'search'	=> 'fulltext',
+			'list'		=> '"{name}" ? "{name}" : Dever::load("component/version-one#name", {version_id})',
 		),
 
 		'user_id'		=> array

+ 1 - 0
component/src/Auditing.php

@@ -23,6 +23,7 @@ class Auditing extends Core
 			$param['user_id'] = $v;
 			$param['project_id'] = $info['project_id'];
 			$param['version_id'] = $info['id'];
+			$param['name'] = $info['name'];
 			$param['status'] = 1;
 			$param['statusDesc'] = '审核中';
 			$id = Dever::upinto('component/auditing', array('option_user_id' => $v, 'option_project_id' => $param['project_id'], 'option_version_id' => $param['version_id']), $param);

+ 2 - 0
component/src/Publish.php

@@ -23,6 +23,8 @@ class Publish extends Core
 			$param['user_id'] = $v;
 			$param['project_id'] = $info['project_id'];
 			$param['version_id'] = $info['id'];
+			$param['name'] = $info['name'];
+			$param['status'] = 1;
 			$id = Dever::upinto('component/publish', array('option_user_id' => $v, 'option_project_id' => $param['project_id'], 'option_version_id' => $param['version_id']), $param);
 			$this->set($v, $id);
 		}

+ 2 - 0
component/src/Revert.php

@@ -23,6 +23,8 @@ class Revert extends Core
 			$param['user_id'] = $v;
 			$param['project_id'] = $info['project_id'];
 			$param['version_id'] = $info['id'];
+			$param['name'] = $info['name'];
+			$param['status'] = 1;
 			$id = Dever::upinto('component/revert', array('option_user_id' => $v, 'option_project_id' => $param['project_id'], 'option_version_id' => $param['version_id']), $param);
 			$this->set($v, $id);
 		}

+ 2 - 0
component/src/Unaudit.php

@@ -23,6 +23,8 @@ class Unaudit extends Core
 			$param['user_id'] = $v;
 			$param['project_id'] = $info['project_id'];
 			$param['version_id'] = $info['id'];
+			$param['name'] = $info['name'];
+			$param['status'] = 1;
 			$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);
 		}

+ 11 - 11
youzan/config/wechat.php

@@ -23,18 +23,17 @@ $config['token'] = array
 	),
 );
 
-$config['card'] = array
+$config['reg'] = array
 (
-	'name' => '发放优惠券',
+	'name' => '注册客户',
 	'method' => 'post',
 	'json' => false,
-	'url' => 'https://open.youzan.com/api/oauthentry/youzan.ump.coupon/3.0.0/take?',
+	'url' => 'https://open.youzan.com/api/oauthentry/youzan.scrm.customer/3.0.0/create?',
 	'param' => array
 	(
 		'access_token' => 'token',
-		'coupon_group_id' => 'coupon_group_id',
+		'customer_create' => 'customer_create',
 		'mobile' => 'mobile',
-		'weixin_openid' => 'weixin_openid',
 	),
 	//针对一些返回的名称,做转换
 	'response' => array
@@ -43,17 +42,18 @@ $config['card'] = array
 	),
 );
 
-$config['get_msg'] = array
+$config['card'] = array
 (
-	'name' => '获取帐号下已存在的模板列表',
+	'name' => '发放优惠券',
 	'method' => 'post',
-	'json' => true,
-	'url' => 'https://api.weixin.qq.com/cgi-bin/wxopen/template/list?',
+	'json' => false,
+	'url' => 'https://open.youzan.com/api/oauthentry/youzan.ump.coupon/3.0.0/take?',
 	'param' => array
 	(
 		'access_token' => 'token',
-		'offset' => '0',
-		'count' => '20',
+		'coupon_group_id' => 'coupon_group_id',
+		'mobile' => 'mobile',
+		'weixin_openid' => 'weixin_openid',
 	),
 	//针对一些返回的名称,做转换
 	'response' => array

+ 2 - 0
youzan/src/Card.php

@@ -27,6 +27,8 @@ class Card
 		if ($project_id > 0 && $key && $touser) {
 			$info = Dever::db('youzan/card')->one(array('option_key' => $key, 'option_project_id' => $project_id));
 			if ($info) {
+				Dever::setInput('mobile', $touser);
+				Dever::load('youzan/user.reg');
 				$update = array();
 				$update['project_id'] = $info['project_id'];
 				$update['card_id'] = $info['id'];

+ 28 - 0
youzan/src/User.php

@@ -0,0 +1,28 @@
+<?php
+/*
+|--------------------------------------------------------------------------
+| 用户管理
+|--------------------------------------------------------------------------
+*/
+namespace Youzan\Src;
+
+use Dever;
+use Main\Lib\Wechat;
+use Main\Lib\Core;
+
+class User
+{
+	# 注册客户
+	public function reg()
+	{
+		$project_id = Dever::input('project_id');
+		$param['mobile'] = Dever::input('mobile');
+		$param['customer_create'] = array
+		(
+			'name' => $param['mobile'],
+		);
+		$param['customer_create'] = json_encode($param['customer_create']);
+		$wechat = new Wechat($project_id);
+		return $wechat->curl('reg', $param);
+	}
+}