|
@@ -35,14 +35,11 @@ class Manage
|
|
|
public function create($id, $name, $data)
|
|
|
{
|
|
|
$code = Dever::param('code', $data);
|
|
|
- $type = Dever::param('type', $data);
|
|
|
$product_id = Dever::param('product_id', $data);
|
|
|
+ $product_id = $id;
|
|
|
if (!$product_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));
|
|
|
if ($code > 0 && $code > $total) {
|