* Change the rule to create the shadow product's name.
This commit is contained in:
@@ -1,2 +1,4 @@
|
||||
ALTER TABLE `zt_product` ADD `shadow` tinyint(1) unsigned NOT NULL AFTER `code`;
|
||||
ALTER TABLE `zt_project` ADD `hasProduct` tinyint(1) unsigned NOT NULL DEFAULT 1 AFTER `code`;
|
||||
|
||||
ALTER TABLE `zt_product` MODIFY `name` varchar(110) NOT NULL;
|
||||
|
||||
+1
-1
@@ -1096,7 +1096,7 @@ CREATE TABLE IF NOT EXISTS `zt_planstory` (
|
||||
CREATE TABLE IF NOT EXISTS `zt_product` (
|
||||
`id` mediumint(8) unsigned NOT NULL auto_increment,
|
||||
`program` mediumint(8) unsigned NOT NULL,
|
||||
`name` varchar(90) NOT NULL,
|
||||
`name` varchar(110) NOT NULL,
|
||||
`code` varchar(45) NOT NULL,
|
||||
`shadow` tinyint(1) unsigned NOT NULL,
|
||||
`bind` enum('0','1') NOT NULL DEFAULT '0',
|
||||
|
||||
@@ -1269,7 +1269,7 @@ class projectModel extends model
|
||||
{
|
||||
/* If parent not empty, link products or create products. */
|
||||
$product = new stdclass();
|
||||
$product->name = !$project->hasProduct ? "{$project->name}_{$projectID}" : ($this->post->productName ? $this->post->productName : $project->name);
|
||||
$product->name = !$project->hasProduct ? "SHADOW_{$project->name}_{$projectID}" : ($this->post->productName ? $this->post->productName : $project->name);
|
||||
$product->shadow = (int)empty($project->hasProduct);
|
||||
$product->bind = $this->post->parent ? 0 : 1;
|
||||
$product->program = $project->parent ? current(array_filter(explode(',', $program->path))) : 0;
|
||||
|
||||
Reference in New Issue
Block a user