|
@@ -5,6 +5,8 @@ namespace app\api\controller;
|
|
|
use app\admin\model\system\SystemAttachment;
|
|
|
use app\models\store\StoreCategory;
|
|
|
use app\models\store\StoreCouponIssue;
|
|
|
+use app\models\store\StoreExchange;
|
|
|
+use app\models\store\StoreOrder;
|
|
|
use app\models\store\StoreProduct;
|
|
|
use app\models\store\StoreService;
|
|
|
use app\models\system\Express;
|
|
@@ -33,38 +35,7 @@ class PublicController
|
|
|
|
|
|
public function test()
|
|
|
{
|
|
|
- $province = SystemCity::where('level', 0)->select();
|
|
|
- $res = "export default [";
|
|
|
- foreach ($province as $k => $v) {
|
|
|
- $child = "";
|
|
|
- $citys = SystemCity::where('level', 1)->where('parent_id', $v['city_id'])->select();
|
|
|
- if (count($citys)) {
|
|
|
- $child = ', "city": [';
|
|
|
- foreach ($citys as $kk => $vv) {
|
|
|
- $childs = "";
|
|
|
- $dictres = SystemCity::where('level', 2)->where('parent_id', $vv['city_id'])->select();
|
|
|
- if (count($dictres)) {
|
|
|
- $childs = ', "area": [';
|
|
|
- foreach ($dictres as $kkk => $vvv) {
|
|
|
- $ress = $kkk == 0 ? ('"' . $vvv['name'] . '"') : (',"' . $vvv['name'] . '"');
|
|
|
- $childs .= $ress;
|
|
|
- }
|
|
|
- $childs .= "]";
|
|
|
- }
|
|
|
- $ress = $kk == 0 ? ('{"name": "' . $vv['name'] . '"') : (',{"name": "' . $vv['name'] . '"');
|
|
|
- if ($childs) $ress .= $childs;
|
|
|
- $ress .= '}';
|
|
|
- $child .= $ress;
|
|
|
- }
|
|
|
- $child .= "]";
|
|
|
- }
|
|
|
- $ress = $k == 0 ? ('{"name": "' . $v['name'] . '"') : (',{"name": "' . $v['name'] . '"');
|
|
|
- if ($child) $ress .= $child;
|
|
|
- $ress .= '}';
|
|
|
- $res .= $ress;
|
|
|
- }
|
|
|
- $res .= ']';
|
|
|
- var_dump($res);
|
|
|
+ StoreExchange::createOrder(StoreOrder::get(294));
|
|
|
}
|
|
|
|
|
|
/**
|