Settled.php 2.07 KB
<?php
namespace Shop;
use LibModels\Web\Shop\SettledData;
/**
 * 商家入驻的模型
 * 
 * @name SettledModels
 * @package shop
 * @copyright yoho.inc
 * @author xiaoxiao.hao <xiaoxiao.hao@yoho.cn>
 */
class SettledModel
{
    public static function insertApply($brandName, $registerStatus, $sellerName, $sellerAddress, $zipCode,
        $contacts, $contactPhone, $contactEmail, $sellerRole, $brandWebsite, $onlineShopWebsite, $categoryInfo,
        $billingCycle, $warehouseAddress, $producer, $invoiceType, $newCycle, $quarterNum, $supplyCycle, $haveStore,
        $storeInfo, $brandMaterial, $goodsMaterial, $uid)
    {
        return SettledData::insertApply(
            $brandName, $registerStatus, $sellerName, $sellerAddress, $zipCode,
            $contacts, $contactPhone, $contactEmail, $sellerRole, $brandWebsite, $onlineShopWebsite, $categoryInfo,
            $billingCycle, $warehouseAddress, $producer, $invoiceType, $newCycle, $quarterNum, $supplyCycle, $haveStore,
            $storeInfo, $brandMaterial, $goodsMaterial, $uid
        );
    }
    
    public static function getOneCategory()
    {
        $oneCategory = SettledData::getOneCategory();
        
        if (isset($oneCategory['code']) && $oneCategory['code'] === 200) {
            $data = array();
            foreach ($oneCategory['data'] as $key => $category) {
                $data[$key]['id'] = $category['category_id'];
                $data[$key]['name'] = $category['category_name'];
            }
            $oneCategory['data'] = $data;
        }
        
        return $oneCategory;
    }

    public static function getTwoCategory($id)
    {
        $twoCategory = SettledData::getTwoCategory($id); 
        
        if (isset($twoCategory['code']) && $twoCategory['code'] === 200) {
            $data = array();
            foreach ($twoCategory['data'] as $key => $category) {
                $data[$key]['id'] = $category['category_id'];
                $data[$key]['name'] = $category['category_name'];
            }
            $twoCategory['data'] = $data;
        }
        
        return $twoCategory;
    }
}