...
|
...
|
@@ -436,11 +436,11 @@ class Api |
|
|
$gradient[$k]['price4'] = $v['price4'];
|
|
|
$gradient[$k]['tidu5'] = $v['tidu5'];
|
|
|
$gradient[$k]['price5'] = $v['price5'];
|
|
|
$num=count($gradient[$k]);
|
|
|
for($i=0;$i<$num/2;$i++){
|
|
|
$n=$i+1;
|
|
|
$info[$i]['tidu']= $gradient[$k]['tidu'.$n];
|
|
|
$info[$i]['price']= $gradient[$k]['price'.$n];
|
|
|
$num = count($gradient[$k]);
|
|
|
for ($i = 0; $i < $num / 2; $i++) {
|
|
|
$n = $i + 1;
|
|
|
$info[$i]['tidu'] = $gradient[$k]['tidu' . $n];
|
|
|
$info[$i]['price'] = $gradient[$k]['price' . $n];
|
|
|
}
|
|
|
}
|
|
|
foreach ($list as $k => $v) {
|
...
|
...
|
@@ -493,11 +493,11 @@ class Api |
|
|
$gradient[$k]['price4'] = $v['price4'];
|
|
|
$gradient[$k]['tidu5'] = $v['tidu5'];
|
|
|
$gradient[$k]['price5'] = $v['price5'];
|
|
|
$num=count($gradient[$k]);
|
|
|
for($i=0;$i<$num/2;$i++){
|
|
|
$n=$i+1;
|
|
|
$info[$i]['tidu']= $gradient[$k]['tidu'.$n];
|
|
|
$info[$i]['price']= $gradient[$k]['price'.$n];
|
|
|
$num = count($gradient[$k]);
|
|
|
for ($i = 0; $i < $num / 2; $i++) {
|
|
|
$n = $i + 1;
|
|
|
$info[$i]['tidu'] = $gradient[$k]['tidu' . $n];
|
|
|
$info[$i]['price'] = $gradient[$k]['price' . $n];
|
|
|
}
|
|
|
}
|
|
|
foreach ($list as $k => $v) {
|
...
|
...
|
@@ -508,6 +508,42 @@ class Api |
|
|
return $list;
|
|
|
}
|
|
|
|
|
|
// 商品信息
|
|
|
function product_arr($product_id)
|
|
|
{
|
|
|
$list = Db::name('product')
|
|
|
->alias('p')
|
|
|
->where(['p.id' => $product_id])
|
|
|
->join('class_con c', 'c.id=p.class_con_id')
|
|
|
->join('logo l', 'l.id=p.logo_id')
|
|
|
->field('p.avatar,p.name,c.class_con,l.logo')
|
|
|
->select();
|
|
|
$tidu_new = Db::name('product')->where(['id' => $product_id])->select();
|
|
|
foreach ($tidu_new as $k => $v) {
|
|
|
$gradient[$k]['tidu1'] = $v['tidu1'];
|
|
|
$gradient[$k]['price1'] = $v['price1'];
|
|
|
$gradient[$k]['tidu2'] = $v['tidu2'];
|
|
|
$gradient[$k]['price2'] = $v['price2'];
|
|
|
$gradient[$k]['tidu3'] = $v['tidu3'];
|
|
|
$gradient[$k]['price3'] = $v['price3'];
|
|
|
$gradient[$k]['tidu4'] = $v['tidu4'];
|
|
|
$gradient[$k]['price4'] = $v['price4'];
|
|
|
$gradient[$k]['tidu5'] = $v['tidu5'];
|
|
|
$gradient[$k]['price5'] = $v['price5'];
|
|
|
$num = count($gradient[$k]);
|
|
|
for ($i = 0; $i < $num / 2; $i++) {
|
|
|
$n = $i + 1;
|
|
|
$info[$i]['tidu'] = $gradient[$k]['tidu' . $n];
|
|
|
$info[$i]['price'] = $gradient[$k]['price' . $n];
|
|
|
}
|
|
|
}
|
|
|
foreach ($list as $k => $v) {
|
|
|
$list[$k]['avatar'] = cdnurl($v['avatar'], true);
|
|
|
$list[$k]['gradient'] = $info;
|
|
|
}
|
|
|
return $list;
|
|
|
}
|
|
|
|
|
|
|
|
|
//删除购物车
|
|
|
public function DeleteCar($shop_id)
|
...
|
...
|
|